I am trying to setup a new password using EditTextPreference. In this Android 4.0.3, clicking the EditTextPreference opens a dialog window where user can enter text. However, on pressing ok, it still shows the old text value and not the newly entered value.
public class MyPreferencesActivity extends PreferenceActivity {
EditTextPreference edp_password = (EditTextPreference) findPreference("pref_key_account_password");
edp_password.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
public boolean onPreferenceChange(Preference preference, Object newValue) {
String password = edp_password.getText();
Log.v(TAG, "Password is: " + password);
return true;
}
});
I spend a while trying to make it work, but couldn't find any good solution. How can I retrive the newly entered text after user presses Ok.