recyclerView.addOnItemTouchListener(new OnItemClickListener() {
@Override
public void onSimpleItemClick(BaseQuickAdapter adapter, View view, int position) {
CheckBox box = view.findViewById(R.id.checkbox);
Volume volume = (Volume) adapter.getData().get(position);
//这里获取到的状态不正确。点击之后CheckBox是勾线状态,打印出来却是false。所以我不得不加了个!号
if (!box.isChecked()) {
Log.d(TAG, "add: " + box.isChecked() + checked.size());
}
});
不知道是不是用法有问题