我有一个简单的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
....我的安卓版本是2.1 (API7) java是1.6,使用eclipse。在package中,有android.jar,在我打开它之后,就有了android.preference包。
即使如此,我还是会得到以下错误:
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)我该怎么办?事先鸣谢
发布于 2012-07-18 11:09:55
如果preferences.xml不在res/xml中,则应该将其移到那里。我猜这可能是你问题的根源。
https://stackoverflow.com/questions/11539692
复制相似问题