I filled the list with some string values..Then after on item click…I’m able to see the Toast message for all checked items…Well the issue is that I want to move the indexes/string/position to a string and display it on next tab…But on next tab it gives me the item which I checked first…
protected void onListItemClick(ListView l, View v, int position, long id) {
//final ViewHolder viewHolder = new ViewHolder();
SparseBooleanArray sp=getListView().getCheckedItemPositions();
String str="";
for(int i=0;i<sp.size();i++)
{
str+=items[sp.keyAt(i)]+",";
}
Toast.makeText(this, ""+str, Toast.LENGTH_SHORT).show();
Product.pro_selected= l.getItemAtPosition(position).toString();;
I use the following to display all selected item..
txtPro=(TextView)findViewById(R.id.select_pro_name);
txtPro.setText(Product.pro_selected);
This code is placed from you navigate to next activity/Screen
in Second Activity get the value of intent and use it.
This will shows you all selected items.
To display them in a List extends ListActivity
To display Selected items