can anyone suggest me a way to perform AlertDialog to confirm the changes when change the CheckboxPreference or SwitchPrerence, ex. if i want to Uncheck the Preference the AlertDialog should warn them like "Are you sure want to uncheck?" plus the dialog should be customizable because i am gonna use own Layout. i don't want the Default Bluestrip Header with the Dialog.
SwitchPreference pref = (SwitchPreference) findPreference("prefkey_use_passcode");
pref.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference arg0, Object arg1) {
DialogPreference dialog = new DialogPreference(getParent());
return false;
}
});
Something like this should work: