java.lang.ClassCastException: android.widget.ExpandableListView$ExpandableListContextMenuInfo

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: https://stackoverflow.com/questions/2321332/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.

以上就是java.lang.ClassCastException: android.widget.ExpandableListView$ExpandableListContextMenuInfo的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏