How to select multiple item in ListView in android.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
This example stores the values you have checked and displays them in a toast. And it updates when you uncheck items http://android-coding.blogspot.ro/2011/09/listview-with-multiple-choice.html
To "update" the Toast message after unchecking some items, just put this line inside the for loop:
so it results:
You have to select the option in
ArrayAdapter
:Actually you can ;) It's just a matter of user experience, right?
Try this, (1) for list control set
(2) define list item as
This is same as
android.R.layout.simple_list_item_multiple_choice
exceptandroid:background="@drawable/txt_view_bg
(3) And define drawable txt_view_bg.xml as
Note:- The preferred way to handle multiple choice is to track choices your-self with on click item click, rather than depending on its state in list.