Skip to main content

Posts

Showing posts from July, 2017

Options menu

Goal of this Lesson + In your Activity if you wish to see the options menu then + First make sure that your activity extends AppCompatActivity. There should be a directory called menu in res directory of your project. If not then create it by right clicking on res director and choose “Android resource directory”.  In the new window choose resource type as menu and leave the directory name to menu ( you can change it if you wish to) and press OK. Right click on res>>menu directory and choose “Menu resource file”. In the new windows give the file name as you want it. Since I am trying to create an Options Menu for ActivityNavigator activity so I will give a meaningful name as “activity_navigator_menu”. This action will create a xml file in the menu directory. You can use the UI to add menu items, remove items, rearrange them and more. I suggest you to fiddle around to get hold on it. Experimenting this the best way to learn :-). You can also just go to text and write