The String array count is three.I am checking the gallery images three from gridview.
Based on array count,it is checked three images.But after Closing the application and come back it always show exceed
debug.It have to again check three checkbox.
MainActivity.java:
String[] strArr = {"One","Two","Three"};
int size = strArr.length;
public void changeSelection(View v, int position) {
if (data.get(position).isSeleted) {
data.get(position).isSeleted = false;
Log.e("UnChecked","Unchecked");
} else if(size < strArr.length){
data.get(position).isSeleted = true;
Log.e("Checked","Checked");
} else {
Log.e("Exceed", "Exceed");
}
((ViewHolder) v.getTag()).imgQueueMultiSelected.setSelected(data.get(position).isSeleted);
}
Can anyone help me with this? Thank you.