1. Are you ready for the Galaxy S20? Here is everything we know so far!

Select item in the list view programmatically

Discussion in 'Android Development' started by AKA001, Mar 3, 2016.

  1. AKA001

    AKA001 Lurker
    Thread Starter

    Hello Everyone,



    I have an ArrayList<String> List which contains some items from the listview all_list. How can I select these items in the list view all_list programmatically by checking the ArrayList<String> List contents?



    for e.g., listview all_list contains [0] apple

    [1] orange

    [2] banana



    In ArrayList<String> List, I have orange so I want item on position 1 on the listview all_list to be selected (highlighted) automatically.



    I have tried using all_list.setItemChecked(), but it does nothing and shuts down the application. I am performing the operation after listing the adapter.
     


  2. Deleted User

    Deleted User Guest

Loading...
Similar Threads - Select item list
  1. Tristan Raghnall
    Replies:
    0
    Views:
    371
  2. Papamalo
    Replies:
    1
    Views:
    296
  3. Lu D
    Replies:
    4
    Views:
    2,626
  4. indratiny
    Replies:
    0
    Views:
    244
  5. CharlesLewis
    Replies:
    2
    Views:
    373
  6. DaveHorne
    Replies:
    0
    Views:
    363
  7. Prashant Sontale
    Replies:
    0
    Views:
    280
  8. chrzjim
    Replies:
    6
    Views:
    658
  9. Randy Hoffman
    Replies:
    0
    Views:
    58
  10. Mingi
    Replies:
    0
    Views:
    1,596

Share This Page

Loading...