Javatpoint Logo
Javatpoint Logo

Android Popup Menu Example

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.

The android.widget.PopupMenu is the direct subclass of java.lang.Object class.

Android Popup Menu Example

Let's see how to create popup menu in android.


It contains only one button.

File: activity_main.xml


It contains three items as show below. It is created inside the res/menu directory.

File: poupup_menu.xml

Activity class

It displays the popup menu on button click.



android popup menu example output 1 android popup menu example output 2 android popup menu example output 3

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA