How to create Options menu in Android App(Same Options/Actionbar Menu on all activities)



Implementing same Options/Actionbar menu on all the Activities can be a tedious task, as you will need to write same code on all the activities. This example

will help you to understand easy method to achieve the same.
Download the sample project from https://goo.gl/23Bqnv

27 thoughts on “How to create Options menu in Android App(Same Options/Actionbar Menu on all activities)”

  1. when opening new activity(instead of toast) from toolbar options menu i have setup a back arrow but instead of going back to previous activity it goes back to previous of previous activity ….how to resolve that

    Reply
  2. I really have a problem with the menus: I want to create a menu that appears in all the rest of the class.
    1- I create a Base class that contains my Menu and implements Activity
    2- then the other classes main1 main2 main3 which "extends" the class Base.

    Problem: 1- I have a conflict with the Xml files of the Basic classes (Menu) and the children classes.
    2- Then I can not access my children view (main1 main2 main 3).

    Thank you in advance for your help !

    Reply

Leave a Comment