开发者

EditTextPreference not set

I want to set开发者_如何转开发 an EditTextPreference every launch of the activity. For that i writed some code to set it but nothing happens:

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.vidange);


    SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
    SharedPreferences.Editor editor1 = settings.edit();
    editor1.putString("prochain_vidange","12560");
    editor1.commit();
    }

What's the problem of this code ? Thank you for your help.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜