开发者

Why won't expandablelistview work with context menus?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜