Class Overview
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.OnMenuItemClickListener |
Interface responsible for receiving menu item click events if the items themselves
do not have individual item click listeners. |
|
[Expand]
Inherited Methods |
From class
java.lang.Object
|
Object
|
clone()
Creates and returns a copy of this Object.
|
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
|
void
|
finalize()
Called before the object's memory is reclaimed by the VM.
|
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
|
int
|
hashCode()
Returns an integer hash code for this object.
|
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
From interface
com.android.internal.view.menu.MenuBuilder.Callback
|
abstract
void
|
onCloseMenu(MenuBuilder arg0, boolean arg1)
|
|
abstract
void
|
onCloseSubMenu(SubMenuBuilder arg0)
|
|
abstract
boolean
|
onMenuItemSelected(MenuBuilder arg0, MenuItem arg1)
|
|
abstract
void
|
onMenuModeChange(MenuBuilder arg0)
|
|
abstract
boolean
|
onSubMenuSelected(SubMenuBuilder arg0)
|
|
Public Constructors
public
PopupMenu
(Context context, View anchor)
Construct a new PopupMenu.
Parameters
| 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.
|
Public Methods
public
Menu
getMenu
()
Returns
- the
Menu associated with this popup. Populate the returned Menu with
items before calling show().
public
void
show
()
Show the menu popup anchored to the view specified during construction.