4

I have a simple preferences.xml:

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >
        <PreferenceCategory
                android:title="First Category">
                <CheckBoxPreference
....

My android version is 2.1 (API7) java is 1.6, use eclipse indigo. In the package explorer there is android.jar and after I opened it there is android.preference package.

Even so I get the following error:

com.android.layoutlib.bridge.MockView cannot be cast to android.view.ViewGroup
Exception details are logged in Window > Show View > Error Log
The following classes could not be found:
- PreferenceCategory (Fix Build Path, Edit XML)
- PreferenceScreen (Fix Build Path, Edit XML)

What should I do? Thanx in advance

Franziee
  • 621
  • 11
  • 28

1 Answers1

20

If preferences.xml is not in res/xml you should move it there. I am guessing that it could be the source of your problem.

wojciii
  • 4,253
  • 1
  • 30
  • 39
  • It was the problem. So I can't view/manage the preferences screen in the graphical editor? – Franziee Jul 18 '12 at 12:17
  • I don't think so. The tutorials that I have used for my own stuff all assume that you create an activity and load the preferences from a xml file. – wojciii Jul 18 '12 at 12:30