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

jQuery clickable div with working mailto link inside -

java - Getting corefrences with Standard corenlp package -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -