I am trying to get an example from the Android 2 Application Development book by Reto Meier to work (page 202). As per the instructions I have created a userpreferences.xml
If you change a preference type from ListPreference to CheckBoxPreference, whilst reusing the same key, then this bug will happen.
The Android framework will store some default data in your app's shared_prefs/preferences.xml file. These old values will be in the old format (such as Int or String, for ListPreference) instead of Boolean (for CheckBoxPreference).
WHen you load your preference activity, it will load this XML file automatically, and cause this crash.
The solution is to just edit this stored XML preference file (shared_prefs/preferences.xml) and remove the old values. Or just delete that XML file.