Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android pop up menus

I cannot find either one of these two views in the source, but have seen them both in many apps. Can anyone please tell me what they are called?

Thanksenter image description here

like image 427
Matt Avatar asked Dec 21 '11 20:12

Matt


People also ask

How do I get a popup menu on android?

Go to app > res > right-click > New > Android Resource Directory and give Directory name and Resource type as menu. Now, we will create a popup_menu file inside that menu resource directory. Go to app > res > menu > right-click > New > Menu Resource File and create a menu resource file and name it as popup_menu.

What is android pop-up menu?

A PopupMenu displays a Menu in a modal popup window anchored to a View . The popup will appear below the anchor view if there is room, or above it if there is not.

Where is popup menu?

Android Popup Menu displays the menu below the anchor text if space is available otherwise above the anchor text. It disappears if you click outside the popup menu.

How do I hide the popup menu in android?

Android hide menu item programmatically fragment To show and hide individual menu item at run-time using Java code, you can call: MenuItem item = menu. findItem(<id>); item. setVisible(<true/false>); where menu is the Menu parameter passed to onCreateOptionsMenu(Menu menu) callback method.


1 Answers

The second one is an options menu from the action bar. I think it is implemented as a ListPopupWindow.

The first one is not part of the Android SDK, though there are various implementations floating around. Here is an example of one designed for use with Google Maps, for example. Here is one designed for the "quick actions" pattern.

like image 58
CommonsWare Avatar answered Oct 25 '22 03:10

CommonsWare