最近学习安卓开发的列表视图(ListView),其中有涉及到了CheckBox这个控件的,在layout的xml文件中定义好的。

但是,运行的时候报错,提示: java.lang.ClassNotFoundException: android.view.Checkbox

怎么会找不到这个类?明明是照着书上敲的啊。。。仔细一看,原来xml文件里是这样写的:

<Checkbox 
    android:id="@+id/crime_list_item_solvedCheckBox"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    />    

注意”Checkbox“这个词,其实是写错了,应该是”CheckBox“,字母B是要大些的,改为大写后,OK了。

java.lang.ClassNotFoundException: android.view.Checkbox_Android开发