Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8349199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:55:22+00:00 2026-06-09T07:55:22+00:00

I have a problem with action bar. I have a action bar in main

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T07:55:24+00:00Added an answer on June 9, 2026 at 7:55 am

    Yes, it is possible. I have three possible solutions:

    1. Add the action items via xml http://developer.android.com/guide/topics/ui/actionbar.html#ActionItems
    2. Your second activity could extend your MainActivity (or better, create an abstract base activity for both, which only creates the menu).
    3. Extract the menu creation in a helper class and call the same method from each activity.

    All three ways are possible, but I would prefer the first one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem. On my layout I have an action bar (which
I have a main menu with an action bar. On create, I run a
I have a refresh menu item in the action bar and my main layout
I have problem with ObjectContext.SaveChanges method: public void Save(Action<object, object> action) { EventAggregator.GetEvent<EntityServiceRequestingEvent>().Publish(true); var
Here's my problem: I have do create a menu/list of actions (which would be
I have a library project in which I define an action bar in layout
I have a slight problem trying to customise the look of the action bar
I have a problem with Jquery function getJSON, the action url does not trigger
I have a problem with the query below in postgres SELECT u.username,l.description,l.ip,SUBSTRING(l.createdate,0,11) as createdate,l.action
I have a simple slide action for LinearLayout View using TouchListener . The problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.