Android Question Open Menu at X,Y ?

abhishek007p

Active Member
Licensed User
Longtime User
Is it possible to open the menu at a given x, y location? currently when i use Activity.OpenMenu it opens at bottom of the activity. i have a custom actionbar so want it to appear near the button pressed.


Thanks,
Abhishek
 

walterf25

Expert
Licensed User
Longtime User
Is it possible to open the menu at a given x, y location? currently when i use Activity.OpenMenu it opens at bottom of the activity. i have a custom actionbar so want it to appear near the button pressed.


Thanks,
Abhishek
There are a few libraries that will allow you to do that, here is one, i'm not sure if it works with the latest android version but you can give it a try
https://www.b4x.com/android/forum/threads/ahquickaction-library-nice-looking-popup-menus.14563/

Good luck!
 
Upvote 0

Phil Ware

New Member
Licensed User
Longtime User
I would also like to implement something similiar. Whist I agree I can use an additional library, it seems a waste given that the exisiting menu forfills my needs perfectly. All the pop up menus i've experimented with don't look as good and just add bloat/complexity to a project. Given that the "activity.openmenu" function opens at the top right of the screen when using the standard actionbar, it surely can't be hard to allow the same location when using a custom bar?

Ideally it would be great if we could specify an X,Y loaction to open at, but failing that even a "TopRight", or "BottomCentered" type option would be great. It surely would also be a really simple implementation?
 
Upvote 0
Top