CommonsWare: https://github.com/commonsguy/cw-advandroid/blob/master/AppWidget/LoremWidget/res/xml/widget_provider.xml your example does not use configuration activity at all and therefore not necessarily PreferencesActivity.
As for PreferencesActivities, it DOES NOT work for setResult (RESULT_CANCELED); in onCreate (9, and then setResult (...) in onBackPressed. There are wired NullPointerExceptions deep in Launcher.java (line 88X). However, it does work with Provider.updateAppWidget () and setResult (RESULT_OK, resultValue); in onCreate a then handle further updates in onBackPressed.
The following cut off may also help:
onCreate() { CheckBoxPreference dark = (CheckBoxPreference)findPreference("xyz"); dark.setChecked(false); ... onBackPressed() { CheckBoxPreference dark = (CheckBoxPreference)findPreference("xyz"); boolean checked = dark.isChecked();
...
source share