In this tutorial, I am going to explain, how to create options menu, subMenu etc..
From Activity class, just override the method, onCreateOptionsMenu(). Then inside the method, create the menu, according to our wish.
Then, override another method called, onOptionsItemSelected. In this, if we select any, menu, what we have to do, will code in this. That means, menu events will be handled in this method.
The screenshot will be look like this.
For adding submenu, we have to use the function called addSubMenu(), in the Menu class
the code is,
The screen shot of this is like this..
When click in the sub menu, we will see the screen like this..