Android: Create a Quick Action Menu

Eric Bergman picture Eric Bergman · Jun 28, 2013 · Viewed 8.6k times · Source

I need to create some type of quick action menu that appears to the right side of the clicked item (button) whenever the user clicks the button.

Here's an example of what I'm trying to achieve:

enter image description here

When the user clicks button1 I want the "sub quick action menu" to appear like it's shown in the image above. Is there anyway to do this 'natively' in android?

I have found this plugin but it only allows you to show the menu from the top or bottom of the button. https://github.com/lorensiuswlt/NewQuickAction3D

Answer

Andy Res picture Andy Res · Jun 28, 2013

As tyczj said, you could achieve that with a PopupMenu. The idea is that the popup menu will inflate a custom view with all the elements, having as background a 9 patch image.
Here's a blog post that shows how to do that. Hope it will help you.