| java.lang.Object | |
| ↳ | android.support.v7.widget.PopupMenu |
Static library support version of the framework's PopupMenu.
Used to write apps that run on platforms prior to Android 3.0. When running
on Android 3.0 or above, this implementation is still used; it does not try
to switch to the framework's implementation. See the framework SDK
documentation for a class overview.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| PopupMenu.OnDismissListener | Callback interface used to notify the application that the menu has closed. | ||||||||||
| PopupMenu.OnMenuItemClickListener | Interface responsible for receiving menu item click events if the items themselves do not have individual item click listeners. | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Construct a new PopupMenu.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Dismiss the menu popup.
| |||||||||||
Inflate a menu resource into this PopupMenu.
| |||||||||||
Called when a menu is closing.
| |||||||||||
Called when a menu item is selected.
| |||||||||||
Called when the mode of the menu changes (for example, from icon to expanded).
| |||||||||||
Called when a submenu opens.
| |||||||||||
Set a listener that will be notified when this menu is dismissed.
| |||||||||||
Set a listener that will be notified when the user selects an item from the menu.
| |||||||||||
Show the menu popup anchored to the view specified during construction.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Construct a new PopupMenu.
| context | Context for the PopupMenu. |
|---|---|
| anchor | Anchor view for this popup. The popup will appear below the anchor if there is room, or above it if there is not. |
MenuInflater that can be used to inflate menu items from XML into the
menu returned by getMenu().Inflate a menu resource into this PopupMenu. This is equivalent to calling popupMenu.getMenuInflater().inflate(menuRes, popupMenu.getMenu()).
| menuRes | Menu resource to inflate |
|---|
Called when a menu is closing.
Called when a menu item is selected.
| menu | The menu that is the parent of the item |
|---|---|
| item | The menu item that is selected |
Called when the mode of the menu changes (for example, from icon to expanded).
| menu | the menu that has changed modes |
|---|
Called when a submenu opens. Useful for notifying the application of menu state so that it does not attempt to hide the action bar while a submenu is open or similar.
| subMenu | Submenu currently being opened |
|---|
Set a listener that will be notified when this menu is dismissed.
| listener | Listener to notify |
|---|
Set a listener that will be notified when the user selects an item from the menu.
| listener | Listener to notify |
|---|
Show the menu popup anchored to the view specified during construction.