Android PopUp Menu

Example:

                                    
                                        // popup_menu.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    
        <item android:id="@+id/item1"
            android:title="Apple"/>
    
        <item android:id="@+id/item2"
            android:title="Orange"/>
    
       <item android:id="@+id/item3"
           android:title="Banana"/>
       <item android:id="@+id/item4"
           android:title="Grapes"/>
   
       <item android:id="@+id/item5"
           android:title="Mango"/>
   
       <item android:id="@+id/item6"
           android:title="Lichi"/>
</menu>


// activity_pop_up_menu_example.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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=".PopUpMenuExample"
        android:padding="16dp"
        android:gravity="center">
    
       <Button
           android:id="@+id/show_popup"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:text="Show Popup"
           android:textColor="@color/colorWhite"
           android:background="@color/colorPrimaryDark"
           />
   
</LinearLayout>


                                    
                                  

Output