Toast not generating text from selected item from list

后端 未结 5 2092
抹茶落季
抹茶落季 2021-01-25 17:42

I\'ve made a simple app in android with list View,In that i want to make a toast when select an item,i have tried as below but its not working..

my code is as below:

5条回答
  •  旧巷少年郎
    2021-01-25 18:38

    I am so confused on what you are doing, why don't you just do it like this:

    String selectedValue = items[position];
    

    instead of:

    String selectedValue =(String) (lv.getItemAtPosition(position));
    

提交回复
热议问题