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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:54:28+00:00 2026-06-03T09:54:28+00:00

Note: PopupMenu is available with API level 11 and higher. http://developer.android.com/guide/topics/ui/menus.html#PopupMenu With that in

  • 0

Note: PopupMenu is available with API level 11 and higher.

http://developer.android.com/guide/topics/ui/menus.html#PopupMenu

With that in mind, how can I link a menu to a View on screen with ABS and the compatibility library? I have a menu imageview on one of my layouts that I would like to provide a universal menu option. Basically by having an imageview that pops up the menu, the same system is in use regardless of device or android version. But if popup only exists on Gingerbread and later, is there another way to link an ImageView (+ click listener) to open up my 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-03T09:54:30+00:00Added an answer on June 3, 2026 at 9:54 am

    Here’s how I ended up solving this:

        ImageView menuImg = (ImageView) activity.findViewById(R.id.menuImageView);
        menuImg.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                activity.openOptionsMenu(); //This is the key method!
            }
        });
    

    public boolean onCreateOptionsMenu(Menu menu) {
        com.actionbarsherlock.view.MenuInflater inflater = getSupportMenuInflater();
        inflater.inflate(R.menu.main_menu, menu);
        return true;    
    }
    

    public boolean onMenuItemClick(MenuItem item) {
         switch (item.getItemId()) {
            case R.id.demographics:
    
                return true;
            case R.id.settings:
                Log.v("v", "settings clicked");
                return true;
            default:
                return false;
         }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note that singleton used in slightly uncommon sense - object visible as single instance
NOTE: This question is only loosely related to tinyxml, however including details like that
Note: I'm a backend (Java) developer by trade and work in Clojure in my
Note: I know that elem {height: 90%} exists. What I need: an element to
Note: for those of you that cannot do better than coming up with boring,
Note: this is in relation to android specifically, but the best answer might not
NOTE: I'm a beginner web developer, somewhat familiar with PHP. I've been curious about
Note: This question was originally part of Magento SOAP API V2 with C#: Issue
Note that when I say client, I mean businesses or organizations that have signed
(NOTE: I have read http://shiningthrough.co.uk/Select-helper-methods-in-Ruby-on-Rails , but still don't know what to pick) I

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.