Reputation: 49
I wish to select multiple ListView items and then share all of them. How can I go about it?
Upvotes: 2
Views: 2625
Reputation: 49
I want that on the click of the option menu item in action bar, the listview's choice mode becomes multiple, which is easy to achieve. Simultaneously i want to inflate two options menu items namely "ok" and "cancel", so that once the user is done selecting some or all listview items, he can click on "ok" option menu to proceed.
Upvotes: 0
Reputation: 7394
See the Awesome example here android-multiple-selection-listview
Upvotes: 3
Reputation: 879
Well,
First you need to create OnItemClickListener(View v) in order to get clicks.
Then you can make a HashMap in order to preserve the items which are clicked.
You can also change the Background of the clicked item so the user will know which items are clicked.
Final thing you need is the action (button click - Share) which will pass through the HashMap and collect all clicked items. After that you can do with them what ever you want.
It looks like a huge work, but it's can easily divided into steps and you close them one by one... It actually quite simply.
Upvotes: 0