use PreferenceActivity OnPreferenceChangeListenerand then register your checkbox. When you find that it has been pressed, turn off preference
findPreference("checkboxpreferencekey").setOnPreferenceChangeListener(this);
public boolean onPreferenceChange(Preference preference, Object newValue){
if(preference.getKey().equals("checkboxpreferencekey")){
preference.setEnabled(false);
return true;
}
else return true;
}
So you can turn it off, you still need some kind of callback or broadcast from your service to find out when to turn it on again. But when you do it the same way.
findPreference("checkboxpreferencekey").setEnabled(true);