i created android preference page , wanted show current option selected in summary.
so implemented onsharedpreferencechanged listener called correctly. however, there no screen change , old option shown.
public void onsharedpreferencechanged(sharedpreferences sharedpreferences, string key) { // update listpreference lp = (listpreference) findpreference(pref_download_web); lp.setsummary(getstring(r.string.pref_listdownloadwebsummary) + ": %s"); }
is known bug?
i noticed updated summary shown when set prefs summary. set summary "dummy" first , real string. works too.
public void onsharedpreferencechanged(sharedpreferences sharedpreferences, string key) { // update listpreference lp = (listpreference) findpreference(pref_download_web); lp.setsummary("dummy"); // required or not update lp.setsummary(getstring(r.string.pref_listdownloadwebsummary) + ": %s"); }
Comments
Post a Comment