0

I have an ActionBar with an OnMenuVisibilityListener and a list of items. When items are selected I show an ActionMode with another menu. I want to listen to show/hide callbacks on the ActionMode overflow menu in a similar way as I do with the ActionBar one. Is there no way get the information that the user opened or closed the overflow menu of an ActionMode?

The OnMenuVisibilityListeneris called when the ActionBar overflow menu is opened or closed (no list items are selected). It it not called when the ActionMode is shown (list items selected)

The ActionModecallback method onPrepareActionMode is called when the ActionMode is created and when the overflow menu is opened - but not when the overflow menu is closed.

FreddaP
  • 121
  • 1
  • 5
  • 1
    See https://stackoverflow.com/questions/23806383/actionbars-overflow-menu-open-close-listener – maja89 Apr 26 '19 at 09:35
  • that all works fine @maja89 - for the ActionBar. It doesn't for the ActionMode. – FreddaP Apr 26 '19 at 09:57
  • 1
    onDestroyActionMode is called when the `ActionMode` is closed, but not when the **ActionMode menu is closed**. – FreddaP Apr 26 '19 at 09:59
  • 1
    There is no callback for ActionMode. If you need it you can set customView and try by adding some listener that may get called when the ActionMenu gets opened. – maja89 Apr 26 '19 at 10:12
  • Don't think that will work @maja89 - as the documentation points out: `Set a custom view for this action mode. The custom view will take the place of the title and subtitle. Useful for things like search boxes.` Didn't try it out though, will give it a spin. – FreddaP Apr 26 '19 at 11:26
  • You right, sorry. My point is if current feature doesn’t support what you need try making your own and use it instead of current one. – maja89 Apr 26 '19 at 11:58

0 Answers0