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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:24:05+00:00 2026-05-15T04:24:05+00:00

I have a ListActivity and I want to implement context menu for each of

  • 0

I have a ListActivity and I want to implement context menu for each of the list elements. I know that the common way to do this is to show the context menu on long click/tap. I want to know if there is a way to show the context menu for each element on a key press(preferably the menu key).
To rephrase my question, how can I trigger the context menu and not the options menu by pressing the menu key(or any other key).

  • 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-05-15T04:24:06+00:00Added an answer on May 15, 2026 at 4:24 am

    To open the context menu, call openContextMenu(). To trigger it via a key, override onKeyDown() or onKeyUp().

    That being said, I really do not recommend this.

    Users complain that Android has no UI standards. Instead, Android has UI conventions, ones that allow developers some freedom (and, more importantly, are not barriers to getting your app listed on the Android Market).

    However, those users’ point is very valid — their experience is marred when apps decide to go off on a UI tangent. Deciding to have the MENU key pop a context menu would be one such tangent. For starters, on touch-screen devices, this will not work very well, because there is no selected item in your ListView, so it would be unclear to the user what the MENU pertains to.

    I suspect that there is a better solution for whatever problem you think you are solving this way.

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

Sidebar

Related Questions

I have a ListActivity containing an object I've defined called a MessageItem. I want
I have a ListActivity . Each item in the ListView contains a RatingBar .
I have a ListActivity where the list items are defined in another XML layout.
I have a ListActivity working as expected. When a list item is clicked the
I have a ListActivity which lists a bunch of things. If you click on
I have created a list view within a tab with a list of teams
I'm watching the 2010 Google I/O video on this topic and I have a
I have created a tabbed view with four tabs and attached four listviews to
I am really struggling with linking menus together. The app I want to create
I just encountered the following situation. I have an Android app with a scenario

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.