How to extract the text from the selected item on the listView

后端 未结 14 2551
轻奢々
轻奢々 2020-11-28 07:55

I have a listview with some items. I would like to get the text from the selected item.

Here is my list adapter and the onItemClickListener:

ListView         


        
14条回答
  •  旧巷少年郎
    2020-11-28 08:30

    If you are using a List to populate the ListView in your onItemClick() method.

    String s = list.get(position);
    

    You need to be able to access this list within the inner class

提交回复
热议问题