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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -