*In the below code, where the item’s position and title is getting saved in 
list_items works fine if list_items and items are ArrayList. For ex;*


*ArrayList.add(ArrayList.get(position));*


*But I am trying to use listview:*

*ArrayList.add(Listview.get(position));*



*The problem exists on line # 10*


1. final Listadapter Adapter = new Listadapter(this,packageList1, 
packageManager);
 

 

2. items.setAdapter(Adapter);
 

3. items.setChoiceMode(apps.CHOICE_MODE_MULTIPLE_MODAL); 


 4. items.setMultiChoiceModeListener(new AbsListView.MultiChoiceModeListener
() {
 

5. @Override
 

6.    public void onItemCheckedStateChanged(ActionMode mode, int position, 
long id, boolean checked) { 


 7.        count = count +1; 


 8.        mode.setTitle(count + "items selected");
 

9.    //problem resides in the below line 


 10.   list_items.add(items.get(position)); 


 11.    }





*In the above code, on selecting an item from listview I am trying to save 
it in an Arraylist i.e list_items which could be used in *onActionItemClicked 
method for further action on that respective item.

 

*Any ideas on how to solve or find a workaround to use a listview in the 
above situation? *



-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/393fe5a9-9c5f-467d-96c5-c490e9696d5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to