Android listview simple_list_item_checked -
i have listview uses android.r.layout.simple_list_item_checked
layout.
i need app detect when user checks item in listview , passes state of checkbox variable.
how done? remember im not using custom layout listview. im using android.r.layout.simple_list_item_checked.
for need enable android:choicemode="multiplechoice"
in layout xml listview
created.
then set onitemclicklistener
on listview
:
@override public void onitemclick(adapterview<?> parent, view view, int position,long id) { sparsebooleanarray sparsebooleanarray = listview.getcheckeditempositions(); system.out.println("clicked position := "+position +" value: "+sparsebooleanarray.get(position)); }
Comments
Post a Comment