ottengo il seguente errore quando passo da XML a GUI per un file di layout preferenze:errore di Eclipse Android quando si passa da GUI xml
Eccezione sollevata durante il rendering: com.android.layoutlib.bridge.MockView non può essere gettato to android.view.ViewGroup I dettagli di eccezione sono registrati in Finestra> Mostra vista> Registro errori Impossibile trovare le seguenti classi: - PreferenceCategory (percorso di compilazione fix, modifica XML) - PreferenceScreen (percorso di compilazione di correzione, modifica XML)
Il mio file xml è simile al seguente:
<?xml version="1.0" encoding="UTF-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<PreferenceCategory
android:title="Activation">
<CheckBoxPreference
android:title="Title1"
android:defaultValue="false"
android:key="checkbox1">
</CheckBoxPreference>
</PreferenceCategory>
<PreferenceCategory
android:title="Option1">
<PreferenceScreen
android:title="Set Option">
<CheckBoxPreference
android:title="ENABLE OPTION"
android:defaultValue="false"
android:summary="text"
android:key="checkboxOption1">
</CheckBoxPreference>
<CheckBoxPreference
android:title="DISPLAY OPTIONS"
android:defaultValue="false"
android:summary="text"
android:key="checkboxDisplay1">
</CheckBoxPreference>
<EditTextPreference
android:title="OPTION2"
android:name="Option2"
android:summary="text"
android:defaultValue="1"
android:key="editOption2">
</EditTextPreference>
<CheckBoxPreference
android:title="OPTION3"
android:defaultValue="false"
android:summary="text"
android:key="checkboxOption3">
</CheckBoxPreference>
</PreferenceScreen>
</PreferenceCategory>
<PreferenceCategory
android:title="Option4">
<PreferenceScreen
android:title="Set Option4">
<CheckBoxPreference
android:title="OPTION4"
android:defaultValue="false"
android:summary=""
android:key="checkboxOption4">
</CheckBoxPreference>
<CheckBoxPreference
android:title="OPTION5"
android:defaultValue="false"
android:summary="text"
android:key="checkboxOption5">
</CheckBoxPreference>
<EditTextPreference
android:title="OPTION6"
android:name="Option6"
android:summary="text"
android:defaultValue="1"
android:key="editOption6">
</EditTextPreference>
<EditTextPreference
android:title="OPTION7"
android:name="Option7"
android:summary="text"
android:defaultValue="1"
android:key="editOption7">
</EditTextPreference>
<EditTextPreference
android:title="OPTION8"
android:name="Option8"
android:summary="text"
android:defaultValue="1"
android:key="editOption8">
</EditTextPreference>
</PreferenceScreen>
</PreferenceCategory>
<PreferenceCategory
android:title="OPTION9">
<PreferenceScreen
android:title="Option9">
<EditTextPreference
android:title="Option9"
android:name="Option9"
android:summary="text"
android:defaultValue=""
android:key="editOption9">
</EditTextPreference>
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>
Tutta l'assistenza sarebbe molto apprezzato
Ho lo stesso identico problema. –