Hello,

Is it possible to activate the selection mode on a ListView configured
with CHOICE_MODE_MULTIPLE_MODAL from an option item ? The default
behavior is to do a long click on the list but I would like to achieve
the same with a button in the ActionBar.

I've tried to reproduce the ActionMode with the following ActionMode
callback started when the user clicks on the button but the items's
selection state isn't reset when the ActionMode is destroyed and they
still appeared checked.

Anyone has an idea ?

new Callback() {

                public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
                        return true;
                }

                public void onDestroyActionMode(ActionMode mode) {
                        ListView listView = getListView();
                        listView.clearChoices();
                        listView.setChoiceMode(ListView.CHOICE_MODE_NONE);
                }

                public boolean onCreateActionMode(ActionMode mode, Menu menu) {
                        
getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
                        return true;
                }

                public boolean onActionItemClicked(ActionMode mode, MenuItem 
item) {
                        return false;
                }
        };

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to