PopupMenu
public
class
PopupMenu
extends Object
| java.lang.Object | |
| ↳ | android.widget.PopupMenu |
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. If the IME is visible the popup will not
overlap it until it is touched. Touching outside of the popup will dismiss
it.
Summary
Nested classes | |
|---|---|
interface |
PopupMenu.OnDismissListener
Callback interface used to notify the application that the menu has closed. |
interface |
PopupMenu.OnMenuItemClickListener
Interface responsible for receiving menu item click events if the items themselves do not have individual item click listeners. |
Public constructors | |
|---|---|
PopupMenu(Context context, View anchor)
Constructor to create a new popup menu with an anchor view. |
|
PopupMenu(Context context, View anchor, int gravity)
Constructor to create a new popup menu with an anchor view and alignment gravity. |
|
PopupMenu(Context context, View anchor, int gravity, int popupStyleAttr, int popupStyleRes)
Constructor a create a new popup menu with a specific style. |
|
Public methods | |
|---|---|
void
|
dismiss()
Dismiss the menu popup. |
View.OnTouchListener
|
getDragToOpenListener()
Returns an |
int
|
getGravity()
|
Menu
|
getMenu()
Returns the |
MenuInflater
|
getMenuInflater()
|
void
|
inflate(int menuRes)
Inflate a menu resource into this PopupMenu. |
void
|
setForceShowIcon(boolean forceShowIcon)
Sets whether the popup menu's adapter is forced to show icons in the menu item views. |
void
|
s |