vendredi 6 mars 2020

java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to android.widget.CheckBox

in Adapter i want to select item and it will be select checkbox so i want to view to checkbox

Here is my code

 CheckBox chk = (CheckBox) view;
            if (chk.isChecked()){
                checkedEventList.add(eventList.get(position));
                Toast.makeText(context, "added", Toast.LENGTH_SHORT).show();

            }else if (!chk.isChecked()){
                checkedEventList.remove(eventList.get(position));

            }else {
                Toast.makeText(context, "Tut", Toast.LENGTH_SHORT).show();
            }

Error

Error




Aucun commentaire:

Enregistrer un commentaire