I have set my ListView choice mode as below:
listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
but after selecting some items and trying to Toast selected items it show me empty string .
how I Toast Selected Items:
String selected = "";
int cntChoice = listView.getCount();
SparseBooleanArray sparseBooleanArray = listView.getCheckedItemPositions();
for (int i = 0; i < cntChoice; i++) {
if (sparseBooleanArray.get(i)) {
selected +=listView.getItemAtPosition(i).toString() + "\n";
}
}
Toast.makeText(getApplicationContext(),selected,Toast.LENGTH_SHORT).show();
I have set Listener for convert view on adapter and the problem is that
so is it possible to manage it ?
i mean is it possible to set item selected on convert view listener?