AndroidのSharedPreferences権限


import android.app.Activity;  
import android.content.SharedPreferences;  
import android.os.Bundle;  
  
public class PermissionActivity extends Activity {  
    private final int[] MODES=new int[]{  
        Activity.MODE_PRIVATE,//      ,          ,         ,     ,              ,                 ,    Activity.MODE_APPEND  
        Activity.MODE_WORLD_READABLE,//
        Activity.MODE_WORLD_WRITEABLE,////              ,    :Activity.MODE_WORLD_READABLE+Activity.MODE_WORLD_WRITEABLE  
        Activity.MODE_APPEND//            ,          ,          
    };  
    @Override  
    public void onCreate(Bundle savedInstanceState) {  
        super.onCreate(savedInstanceState);  
        setContentView(R.layout.main);  
          
        for(int i=0;i<MODES.length;i++){  
            SharedPreferences mySharedPreferences=getSharedPreferences("data_"+String.valueOf(i+1),MODES[i]);  
            SharedPreferences.Editor editor=mySharedPreferences.edit();  
            editor.putString("name",String.valueOf(i+1));  
            editor.commit();  
        }  
    }  

}

getsharedPreferences sharedpreferences ,getsharedPreferences 2 Activity.MODE_PRIVATE 。 3 。 4 。 , 。

   0 MODE_PRIVATE, Preference, : preference Context.MODE_WORLD_READABLE Context.MODE_WORLD_WRITEABLE 。