On Tuesday, September 27, 2011 5:41:46 PM UTC+2, Mark Murphy (a Commons Guy) wrote:
On Mon, Sep 26, 2011 at 8:06 AM, MrArti <[email protected]> wrote: > > > 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. > > Assuming that by "when the ActionMode is destroyed" you mean when the > user clicks the Done button, I have seen that same issue and I have > not determined yet how to get past it. > > For cases where you finish() the action mode, you can call > clearChoices() in onDestroyActionMode(). However, the Done button does > not seem to invoke onDestroyActionMode() in the testing I have done to > date. > Posting a followup to this thread... I know it's a couple of months old, but I haven't seen a resolution to this issue. I have found that the the Done button WILL invoke onDestroyActionMode() if your callback is an instance of AbsListView.MultiChoiceModeListener, rather than simply ActionMode.Callback. You need to implement one more method (for onItemCheckedStateChanged()), but it can simply be a no-op stub. My impression is that ActionMode.Callback not calling onDestroyActionMode() is a bug, and should probably be reported (comments anyone?), but in the meanwhile this seems like a reasonable workaround. String -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

