I'm making a list of check items and using a recycler view to update the list when a new item is added. I'm able to check and uncheck them just fine but after having about 6 checked items I run into a problem.
The problem is that adding a new item to the list containing 6 checked items will result in a couple of the checked items becoming unchecked. I have no idea where the problem could possibly be and no one else seems to have had this problem.
Here is my checkbox XML:
xmlns:android="http://ift.tt/nIICcg"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<CheckedTextView
android:id="@+id/checkedTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="itemClick"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"/>
And this is how I check the box when you tap on it:
public void itemClick(View view)
{
Snackbar.make(view, "Checklist Item Checked! ", Snackbar.LENGTH_LONG).setAction("Action", null).show();
CheckedTextView checkList = (CheckedTextView) view.findViewById(R.id.checkedTextView);
checkList.toggle();
}
Aucun commentaire:
Enregistrer un commentaire