views:

101

answers:

1

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 adapter 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.

A: 

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.

Christian
It hasn't led to my solution quite yet, but putting in the listener actually made the long click register and the context menu shows up. I still don't get the selector animation (orange to white fade) and it doesn't respond to D-pad input.
CodeFusionMobile
You could redirect the click to the right view by calling performClick() or performLongClick() on the right view.
Christian