android - Reset to Default Preferences not updating EditTextPreferences -
i trying implement reset default option, part of settings. reverts default value. issues when reset how can update edittextpreference value newvalue? updates after exiting activity , returning it.the preference correctly updated not actual content of edittextp. give thanks time reading this!
@override public void onclick(dialoginterface dialog, int which) { sharedpreferences preferences = preferencemanager.getdefaultsharedpreferences(preferencesactivity.this); sharedpreferences.editor editor = preferences.edit(); editor.clear(); editor.commit(); preferencemanager.setdefaultvalues(preferencesactivity.this, r.xml.preferences, true); editor.commit(); checkboxpreference enableedit = (checkboxpreference)findpreference("ischecked"); enableedit.setchecked(false); } });
android clear edittextpreference
No comments:
Post a Comment