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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:55:02+00:00 2026-06-15T12:55:02+00:00

As Android doesn’t support icons in context menus, I decided to replace the native

  • 0

As Android doesn’t support icons in context menus, I decided to replace the native ActionBar More menu item with my own custom item. The problem is that it doesn’t listen for the Menu hardware key presses. Is there any way I can implement this behavior? Actually the problem is to find a way to activate an item in ActionBar by pressing a key. Thanks in advance.

  • 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-15T12:55:03+00:00Added an answer on June 15, 2026 at 12:55 pm

    To display your menu (which is an ActionBar item as well) on a hardware menu button click, you can do this (you need to keep a reference to your Menu in the OnCreateOptionsMenu callback):

    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if(event.getAction() == KeyEvent.ACTION_DOWN){
            switch(keyCode) {
            case KeyEvent.KEYCODE_MENU:
                mainMenu.performIdentifierAction(R.id.your_custom_menu, 0);
               return true;  
        }
        return false;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Home sample in the android sdk doesn't implement the Add item, which bring
I'm using Google API 8 (Android 2.2) with support package v4. It doesn't give
Why does my Android time widget doesn't update on its own? I created a
I tried to develop application in persian language, as i understood android doesn't support
Android doesn't allow strings containing '?' because it has special meaning in XML context.
I know Android doesn't support MJPEG natively but are there any jar files/drivers available
I've not used JSON before and as Android doesn't support SOAP I'm trying to
Android doesn't support many media file formats (files like .mkv), by default. But players
In Eclipse my Android SDK Manager doesn't show as far back as API level
I have a strange problem with opengl es(Android) .Some textures doesn't drawing correct ,its

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.