rai
rai

Reputation: 23

How to Use Menu in Complete Application in Android

I am working on an application in android. Where I need to use menu through out application. Actually it will be used for navigating within application from one activity to other and so on... I am wondering that it will need to write onOptionMenuCreat and OnOptionMenuSelect methods in each activity. Also if I make one parent activity where these two methods could be written even then on each activity Option Menu will be created again. So handling same menu while it is created again is becoming work of afaik. Any good design suggestions are most welcomed. Another very important thing how to map that user was on witch activity last time while selecting same menu again. My app has total five menu options so that means there are five different ways to move within application simultaneously.

Please Do tell me solution for both issues. Thank You.

Upvotes: 1

Views: 520

Answers (1)

GSree
GSree

Reputation: 2898

You create the Menu in an Activity and inherit all the other Activities from this Activity.

To answer the second part.

create a different method for each menu handling in the parent activity. If you need a different menu/menu_item behaviour for your activity, just override that method.

Upvotes: 1

Related Questions