sharedpreferences记得commit

 

        SharedPreferences setting=this.getSharedPreferences("haha", 0);
        Editor editor=setting.edit();
        editor.putString("names", "saul");
        editor.commit();
        String str=setting.getString("names", "");
        Log.d("name", str);

你可能感兴趣的:(sharedpreferences记得commit)