Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/195.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android gridview中的有限复选框_Android_Checkbox - Fatal编程技术网

Android gridview中的有限复选框

Android gridview中的有限复选框,android,checkbox,Android,Checkbox,如何在网格视图中为复选框选择设置5限制?我正在使用SparseBooleanArray holder.cb.setTag(position); holder.cb.setContentDescription(Uri.withAppendedPath( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "" + imageID).toString()); holder.cb.setChecked(mSparseBooleanArray.get(

如何在网格视图中为复选框选择设置5限制?我正在使用SparseBooleanArray

holder.cb.setTag(position);
holder.cb.setContentDescription(Uri.withAppendedPath(
      MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "" + imageID).toString());
holder.cb.setChecked(mSparseBooleanArray.get(position));
holder.cb.setOnCheckedChangeListener(new OnCheckedChangeListener() {
    @Override
    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
        // TODO Auto-generated method stub
        mSparseBooleanArray.put((Integer) buttonView.getTag(),  isChecked);
    }
});

你的问题不清楚。请描述更多。如何限制网格视图中的复选框选择?