1. AC Question's Avatar
    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?
    02-14-2016 02:13 AM

Similar Threads

  1. Distorted audio when mirroring note 5 using fire tv stick
    By AC Question in forum Ask a Question
    Replies: 0
    Last Post: 02-14-2016, 02:05 AM
  2. Using a paired smartwatch to answer a call
    By AC Question in forum Ask a Question
    Replies: 0
    Last Post: 02-14-2016, 02:00 AM
  3. Replies: 1
    Last Post: 02-14-2016, 01:22 AM
  4. Replies: 1
    Last Post: 02-14-2016, 01:21 AM
  5. Using a paired smartwatch to answer a call
    By AC Question in forum Ask a Question
    Replies: 0
    Last Post: 02-14-2016, 01:10 AM
LINK TO POST COPIED TO CLIPBOARD