Introduction
In this article, I will show you how to create a pop-up menu Android app using Android Studio. Android Popup menu displays the menu below the anchor text if space is available otherwise, it displays the menu above the anchor text. It disappears if you tap outside the pop-up menu.
Requirements
- Android Studio version 2.3.3
- Little bit XML and JAVA knowledge.
- Android Emulator (or) Android mobile
- Download link (Android Studio)
Steps to be followed
Follow these steps to create a pop-up menu Android app. I have included the source code below.
Step 1
Open Android Studio and start a new Android Studio Project.

Step 2
You can choose your application name and choose where your project is stored. If you wish to use C++ for coding the project, mark the "Include C++ support", and click the "Next" button.

Step 3
Now, select the version of Android and select the target Android devices. We need to choose the SDK level which plays an important role in running the application.

Step 4
Now, add the activity and click the "Next" button.

Step 5
Add Activity name and click "Finish".

Step 6
Go to activity_main.xml. This XML file contains the designing code for your Android app.

- <RelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="abu.popup.MainActivity" >
- <TextView
- android:id="@+id/textView1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="POP UP " />
- <Button
- android:id="@+id/button1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:layout_marginLeft="62dp"
- android:layout_marginTop="50dp"
- android:text="Show Popup" />
- </RelativeLayout>
Step 6
Go to Main Activity.java. This Java program is the backend language for Android.
The Java code is given below.







Join the conversation! Your thoughts help the community grow.