I have ListView
with custom Adapter
which supplies View
to ListView
in this way:
public View getView(i
Well i know none of the above solutions will work.I tried changing xml attributes but those does not work out, But i implemented it in a new fashion. Here is how:
Create an interface CheckBoxOnCheckListener
with method onCheckBoxChecked
and pass needed parameters, implement interface CheckBoxOnCheckListener
in your activity or fragment containing listView.
Next in your adapter, declare an mListener
as CheckBoxOnCheckListener
, and pass this as a parameter to Adapter's constructor from fragment/activity
and cast it to CheckBoxOnCheckListener
and assign to mListener
.
Next set mListener
as itemView.onClick
or CheckBox.onCheckCheckedListener
and onCheckChanged
method call mListener.onCheckBoxChecked
.
That's it. It will definitely work,it worked for me. For code just pm.
just add this line into the item views instead of listView itself
android:focusable="false"
check more detail about this from Android custom ListView unable to click on items