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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:09:37+00:00 2026-05-30T10:09:37+00:00

I am really hoping someone will be able to help me here. I am

  • 0

I am really hoping someone will be able to help me here.
I am working off of this example:
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ExpandableList1.html

And I am trying to capture which item invoked the contextMenu.
The only example I could find was here:

Detecting which selected item (in a ListView) spawned the ContextMenu (Android)

The only difference is that I have an ExpandableListView instead of a ListView.

When I use the example above from stackoverflow , I receive the following Exception:

02-25 21:08:27.271: E/AndroidRuntime(7812): java.lang.ClassCastException: android.widget.ExpandableListView$ExpandableListContextMenuInfo
02-25 21:08:27.271: E/AndroidRuntime(7812):     at com.frugalicious.android.CategoryList.onCreateContextMenu(CategoryList.java:121)
02-25 21:08:27.271: E/AndroidRuntime(7812):     at android.view.View.createContextMenu(View.java:4362)
02-25 21:08:27.271: E/AndroidRuntime(7812):     at com.android.internal.view.menu.ContextMenuBuilder.show(ContextMenuBuilder.java:81)
02-25 21:08:27.271: E/AndroidRuntime(7812):     at com.android.internal.policy.impl.PhoneWindow$DecorView.showContextMenuForChild(PhoneWindow.java:1880)
02-25 21:08:27.271: E/AndroidRuntime(7812):     at android.view.ViewGroup.showContextMenuForChild(ViewGroup.java:460)
02-25 21:08:27.271: E/AndroidRuntime(7812):     at android.view.ViewGroup.showContextMenuForChild(ViewGroup.java:460)
02-25 21:08:27.271: E/AndroidRuntime(7812):     at android.view.ViewGroup.showContextMenuForChild(ViewGroup.java:460)
02-25 21:08:27.271: E/AndroidRuntime(7812):     at android.widget.AbsListView.performLongPress(AbsListView.java:1874)
02-25 21:08:27.271: E/AndroidRuntime(7812):     at android.widget.AbsListView.access$600(AbsListView.java:74)
02-25 21:08:27.271: E/AndroidRuntime(7812):     at android.widget.AbsListView$CheckForLongPress.run(AbsListView.java:1827)
02-25 21:08:27.271: E/AndroidRuntime(7812):     at android.os.Handler.handleCallback(Handler.java:587)

I will provide any other information needed. Thank you so much 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-05-30T10:09:38+00:00Added an answer on May 30, 2026 at 10:09 am

    When I use the example above from stackoverflow , I receive the
    following Exception

    With above statement you mean you literally copy-pasted the answer on the linked question? If so, it’s hardly surprising you get a ClassCastException. Try casting to a ExpandableListView.ExpandableListContextMenuInfo, as the exception suggests in stead.

    @Override
    public void onCreateContextMenu(ContextMenu contextMenu, View v, ContextMenu.ContextMenuInfo menuInfo) {
        ExpandableListView.ExpandableListContextMenuInfo info =
                (ExpandableListView.ExpandableListContextMenuInfo) menuInfo;
       // ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a really simple question, but I am hoping someone will be able
I'm really hoping someone can help me out with this one. I've been stuck
I'm not really good with regular expressions, so I'm hoping someone could help come
Hi this is something that's really bothering me and I'm hoping someone has an
I'm a beginner jquery user so I'm really hoping this will be quite straight
I'm hoping someone will be able to point me in the right direction. I'm
I've run into a really strange bug, that I'm hoping someone can explain. I
I'm hoping someone can help me see the real value in these tests because
I'm hoping someone with Javascript experience can help me out with these tabs. Basically,
I was hoping someone could have a look and tidy this up for me;

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.