开发者

Why won't expandablelistview work with context menus?

开发者 https://www.devze.com 2023-01-19 01:07 出处:网络
My app used to use a standard ListView, and registerForContextMenu(getListView()) and everything worked just fine.

My app used to use a standard ListView, and registerForContextMenu(getListView()) and everything worked just fine.

I needed to change my app to accommodate nested lists so I replaced the ListView with ExpandableListView. I changed the Activity to ExpandableListActivity. I also changed my adapter to a tree ada开发者_开发知识库pter and implemented a custom view class to populate the list with (based on a FrameLayout view).

Suddenly my context menus stopped working and I can't figure out why. I can't long click on any of my list items and I'm completely stuck on where to start looking.


Probably another view then your listitems receives the longclick. I would add OnLongClickListener to all views and create log what listener gets triggered by a longclick.

Otherwise it might help to see something from your code to spot an error.

0

精彩评论

暂无评论...
验证码 换一张
取 消