Android Context Menu

Example:

                                    
                                        // context_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"/>
</menu>



// activity_context_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=".ContextMenuExample"
        android:orientation="vertical"
        android:padding="16dp"
        android:gravity="center">
   
       <TextView
           android:id="@+id/longpress"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:text="Long Press Here"
           android:textSize="30sp"
           android:textColor="@color/colorOrange"
           android:textStyle="bold"
           android:gravity="center"/>
   
</LinearLayout>

                                    
                                  

Output