I\'m developing an app and I have one ListActivity
, which has choice mode set to choice_mode_multiple
. now i want to override method, which is called w
Set onlistitemclick listener to listview , then in itemclick method you can get mylistView.getCheckedItemCount() , write the code of the operation to be performed.
If this is not clear let me know what you want to implement when item is checked.
mylistView = (ListView)customView.findViewById(R.id.mylist);
mylistView.setAdapter(mFolderAdapter);
mylistView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
mylistView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView> arg0, View v,
int arg2, long arg3) {
// TODO Auto-generated method stub
if(mylistView.isItemChecked(arg2)){
//Dooperation
}
// or
if(mylistView.getCheckedItemCount()>1){
//Dooperation
}
}
});