Android: Registering ContextMenu for a Custom ListAdapter

Posted by primal on Stack Overflow See other posts from Stack Overflow or by primal
Published on 2010-05-11T17:21:47Z Indexed on 2010/05/11 17:24 UTC
Read the original article Hit count: 399

Filed under:
|
|
|

Hi,

I made a custom list adapter extending the Base adapter. Each item in the list has an imagebutton, 2 textviews and a button. I tried to add the context menu to the list so as to display some options for an item in the list.

registerForContextMenu(getListView());

I used a MenuInflater object to inflate the context menu xml file. But on clicking the items in the list nothing shows up or the usual highlighting of the item of list on click isn't shown. Is it that the context menu doesn't work for custom list views? Any help would be much appreciated.

Regards, Primal

© Stack Overflow or respective owner

Related posts about android

Related posts about list