Android floating options menu doesn't support icon. In this example I have demonstrated how we can use an Android popup menu as Android options menu. As we know android options menu doesn't allow us to dispaly icons with text, so sometimes it become important to use android popup menu as Android options menu with icons and text.
Step 1: Create a new project in Android Studio and name it Android options Menu with icon .
Step 2: Create a folder menu inside res directory if it is not already present.
Step 3: Open res -> menu and add a new menu resource file with a name
Step 4: Open res -> menu and add a new menu resource file with a name
Note: Please note that I have defined onClick attribute of item element here. So, we'll implement a method in our activity with same name that will handle click event of this item.
Step 5: Open MainActivity.java and replace its code with below given code.
Step 6:Clean and run your project to see the result.