java - Check if checkBoxPreference is "true" -


i have preferences 10 checkboxpreferences , need list how checked, eg 6/10 idea?
tried something, absolutely failed.

i believe you're talking checkboxpreference class in android, in case need register sharedpreferences.onsharedpreferencechangelistener , implement method:

private static final string checkbox_key = "your_checkboxpreference_key";  @override public void onsharedpreferencechanged(sharedpreferences sharedpreferences, string key) {   if(key.equals(checkbox_key)) {     if(sharedpreferences.getboolean(key, true)) {       //your code here     }   } } 

Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -