For anyone who has run into this problem. What I ended up doing was to listen for the long press with the GestureListener
. Once the long press event is triggered, I register the view
for a context menu with registerForContextMenu(View v)
, then call openContextMenu(View v)
.
And in order to not have the context menu pop up and interfere with the long press event, I overrode the onContextMenuClosed(Menu menu)
method, in which I call unregisterForContextMenu(View v)
passing the view
that I earlier registered.