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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:13:15+00:00 2026-05-29T06:13:15+00:00

I have a Activity class and a Renderer class (extends GLSurfaceView implements Renderer). Inside

  • 0

I have a Activity class and a Renderer class (extends GLSurfaceView implements Renderer).
Inside the Renderer class, I have an “onTouchEvent” method to handle touch events like rotation.

Now, I want to display a Menu that pops up on touching some part of the screen. I found that I need to implement a Menu in the Activity class(as we get the MenuInflator object here). However, I want to implement the Menu inside the onTouchEvent in my Renderer class so that the Menu shows up when some part of the screen is touched.

How can I implement this?

I am using Android/java/opengl1.0 .

  • 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-29T06:13:15+00:00Added an answer on May 29, 2026 at 6:13 am

    Perhaps, you can do what you want with a context menu, which integrates well.
    You can either override onCreateContextMenu() in the activity and disable long press for context menu etc. or implement this method with another name.
    Then, you have to call this method from inside your renderer, which has access to its enclosing activity. Maybe, you want to move some invariant params like View v into the method.

    public void createMyContextMenu(ContextMenu menu, View v,
                                    ContextMenuInfo menuInfo) {
        super.onCreateContextMenu(menu, v, menuInfo);
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.context_menu, menu);
    }
    

    Android – how to disable long press on Search button (Nexus One)

    http://developer.android.com/guide/topics/ui/menus.html#context-menu

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

Sidebar

Related Questions

I have Activity with ListView inside it and in the onCreate method of the
I have an activity that launches another activity with startActivityForResult method. I would like
I have the activity: public class Mtest extends Activity { Button b1; Button b2;
I have an android activity in which I'm using tabs. public class UnitActivity extends
I have an Activity Class with an inner protected class that extends AsyncTask. I
I have a simple Hello World application public class TestLeaksOnFinish extends Activity { static
If I have defined a Activity: public class DialogActivity extends Activity{ @Override public void
I have some code here (my activity class and some class, that extends WebViewClient)
Let's say I have 3 classes. Class A (extends Activity) Class B Class C
I have an Activity class (WiFiTest), inside which I have defined a private class

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.