Android context menu custom positioning?
I have managed to do this for Toasts and Dialog boxes, but now the trouble of context menu has arisen. Is it possible in Android to position a context menu to a different location programmatically? I want to be able to specify the position anywhere on the screen as part of a custom user interface, but I cannot seem开发者_如何学运维 to figure out how to do this. Thanks in advance.
As I noted in my comment, I went with a PopupWindow for the actual menu view. It contained a ListView for the menu items with appropriate event listeners. I attached the context menu by overriding the long press listener and adding the PopupWindow at event.getRawY()
.
精彩评论