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 7786261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:23:19+00:00 2026-06-01T20:23:19+00:00

Begginer to Android development. I am developing a application, which have three different tabs.

  • 0

Begginer to Android development. I am developing a application, which have three different tabs. I want to have common menu options. Problem is when menu item is clicked nothing happens. It works when i moved them to activity for first tab.
Here is my TabActivity menu implementation.

@Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater menuInflater = getMenuInflater();
        menuInflater.inflate(R.menu.menu, menu);
        return true;
    }

    @Override
    public boolean onMenuItemSelected(int featureId, MenuItem item) {
        switch(item.getItemId()) {
            case R.id.feedbackEmail:
                showDialog(FEEDBACK_DIALOG_ID);
                return true;
            case R.id.about:
                AboutBox.Show(this);
                return true;
            case R.id.Help:
                HelpBox.Show(this);
                return true;
            case R.id.Preferences:
                Intent intent = new Intent(this, Preferences.class);
                startActivity(intent);
                return true;
            case R.id.powerUsage:
                startActivity(intentPowerUsage);
                return true;
            case R.id.close:
                Intent homeIntent = new Intent(Intent.ACTION_MAIN);
                homeIntent.addCategory( Intent.CATEGORY_HOME );
                homeIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                Preferences.cancelNotification(this);
                startActivity(homeIntent);
                return true;
        }
        return super.onMenuItemSelected(featureId, item);
    }

Here is my menu.xml

<?xml version="1.0" encoding="utf-8"?>

<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/feedbackEmail"
          android:icon="@android:drawable/ic_dialog_email"
          android:title="@string/feedback" />
    <item android:id="@+id/Help"
          android:icon="@android:drawable/ic_menu_help"
          android:title="@string/menu_help" />
    <item android:id="@+id/Preferences"
          android:icon="@android:drawable/ic_menu_preferences"
          android:title="@string/preferences" />
    <item android:id="@+id/about"
          android:icon="@android:drawable/ic_menu_info_details"
          android:title="@string/menu_about" />
    <item android:id="@+id/powerUsage"
          android:icon="@android:drawable/ic_menu_today"
          android:title="@string/powerUsage" />
    <item android:id="@+id/close"
          android:icon="@android:drawable/ic_menu_close_clear_cancel"
          android:title="@string/exit" />
</menu>
  • 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-01T20:23:20+00:00Added an answer on June 1, 2026 at 8:23 pm

    You can do in like this,

    Create an Activity named BaseActivity and put this Menu code in that BaseActivity, then extends all the Activity that you want to have menu. You can check this answer for further reference that overrides onKeyDown() for every Activity.

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

Sidebar

Related Questions

i am begginer to jquery and have a simple problem.. I want to make
I created a Android application for Honeycomb (particularly 3.1) with three distinct tabs. In
I am a begginer in android,here I have activity that use web service: SoapObject
Well, now i have a new problem. Im writing code in C# I want
i have a basic function which requires serializing in my android app. The user
Begginer android programer, I want add and remove item from String list when user
I am a begginer C++ programmer. In C#, I used the System.Net.Sockets.Socket class, which
I'm begginer in asp.net mvc and i have some doubts. P.S: I'm using DDD
I'm making a Grade log application and I have this piece of code here
Hi i'm a c# begginer and i'd like to do a simple program which

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.