由于checkbox的点击事件优先级比listview的高,所以要在checkbox中添加android:focusable=”false”,使得checkbox初始的时候没有获取焦点。
android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"
添加这三句话错误解决
<CheckBox
android:id="@+id/cb_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:checked="true"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false" />