android - CheckboxPreference onClick() -
i want implement 2 part preference screen. if checkbox clicked, first category should lock , 2nd 1 unlock. if it's not, reverse. see works if go previous activity , new (sharedpreferences). listener should override , how?
you try like:
final preference otherpref = (preference) findpreference("otherpref"); final preference pref = (preference) findpreference("checkbox"); ppref.setonpreferenceclicklistener(new onpreferenceclicklistener() { public boolean onpreferenceclick(preference preference) { otherpref.setselectable(false); toast.maketext(getbasecontext(), "some text", toast.length_short).show(); return true; } });
and disable desired categories.
Comments
Post a Comment