Android Option Menu
Option Menu:
The options menu is usually the default or one that is related with an activity or context of the application and is invoked when the user hits the ‘menu’ key on their device.
It commonly is situated in the application bar on top of the screen in Windows® operating systems.
The options menu offer a form by which users can get to other facets or functions within the app.
Example:
// option_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="Item 1"/>
<item android:id="@+id/item2"
android:title="Item 2"/>
<item android:id="@+id/item3"
android:title="Item 3"/>
</menu>
// activity_option_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=".OptionMenuExample"
android:orientation="vertical"
android:padding="16dp"
android:gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="To see option menu click on three dots right hand corner in ActionBar"
android:textSize="20sp"
android:textColor="@color/colorOrange"
android:textStyle="bold"/>
</LinearLayout>
Output