Reputation: 7191
I have a problem with action bar. I have a action bar in main activity which is creating in onCreateOptionsMenu(Menu menu). Items I am adding in this method too. Now I want to that when I click on my item in second activity was the same action bar. I want that when I copy and paste code from this method to method in second activity it work but I don't want to copy this code because I add a lot of items. This is possible to use action bar from first activity in second activity?
Upvotes: 0
Views: 2065
Reputation: 5040
Yes, it is possible. I have three possible solutions:
All three ways are possible, but I would prefer the first one.
Upvotes: 2