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

  • Home
  • SEARCH
  • 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 8783019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:43:13+00:00 2026-06-13T20:43:13+00:00

We are targeting android 2.2+ I am trying to use androids built in system

  • 0

We are targeting android 2.2+

I am trying to use androids built in system regarding the hardware menu button still found on many phones. However I have had no luck and no error message:

/res/menu/optionsmenu.xml

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

<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/menuHelp"
          android:title="Help"
          />
    <item android:id="@+id/menuShowInstallationCode"
          android:title="Show Installation Code"
          />
</menu>

in the activity class

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


public boolean onOptionsItemSelected(MenuItem item){
    switch (item.getItemId()){
        case R.id.menuHelp :
            return true;

        case R.id.menuShowInstallationCode :
            return true;

        default:
            return super.onContextItemSelected(item);
    }
}

The result so far is, that I press the menu button and nothing happens. Really nothing, no error message, no menu, nothing.

I would like a menu to appear. Anyone have any ideas?

  • 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-13T20:43:14+00:00Added an answer on June 13, 2026 at 8:43 pm

    You should return true in onCreateOptionsMenu() and return super.onOptionsItemSelected(MenuItem item) in onOptionsItemSelected(MenuItem item) after switch statement. Please change to:

    @Override
    public boolean onCreateOptionsMenu(Menu menu){
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.optionsmenu, menu);
        return true;
    }
    
    
    public boolean onOptionsItemSelected(MenuItem item){
        switch (item.getItemId()){
            case R.id.menuHelp :
                return true;
    
            case R.id.menuShowInstallationCode :
                return true;
    
        }
        return super.onOptionsItemSelected(item);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found a lot of online resources regarding targeting a variety of Android versions
I'm using the Android compatibility library, targeting Android 2.2. If I use ListFragment With
My program is targeting Android 1.5. I would like to retrieve system information about
I'm trying to make use of Actionbar Sherlock 4, targeting sdk 15 and min
I've got an app that I've written targeting Android 2.1 which makes use of
I am trying to implement signature capture using Rhodes targeting an Android tab. I
I developed one simple android application targeting the Mobiles with android 2.0 OS.I want
I'm targeting .NET 3.5, but cannot get System.Data to come up in Intellisense. What
When I use a conditional statement targeting IE6 and below with some PHP code
I'm building a mobile web app targeting Android users. I need to know what

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.