Skip to content Skip to sidebar Skip to footer

Classcastexception From A Preferenceactivity

I'm getting a classCastException every time I try to use this preference class, and I can't figure out why. Any help would be much appreciated. The line the crashes is the addPrefe

Solution 1:

The top element of the xml file should be PreferenceScreen not Preference

<?xml version="1.0" encoding="utf-8"?><PreferenceScreenxmlns:android="http://schemas.android.com/apk/res/android"><CheckBoxPreferenceandroid:key="pref_sync"android:title="@string/pref_sync"android:summary="@string/pref_sync_summ"android:defaultValue="true" /><ListPreferenceandroid:dependency="pref_sync"android:key="pref_syncConnectionType"android:title="@string/pref_syncConnectionType"android:dialogTitle="@string/pref_syncConnectionType"android:entries="@array/pref_syncConnectionTypes_entries"android:entryValues="@array/pref_syncConnectionTypes_values"android:defaultValue="@string/pref_syncConnectionTypes_default" /></PreferenceScreen>

Extracted from the settings documentation

Post a Comment for "Classcastexception From A Preferenceactivity"