Re: Programatically open context menu - possible?

I think the question here is, why are you trying to do this? Context menus open on long press for a reason, they relate to an object the user has selected. Maybe what you need is the action menu rather than a context menu, they look almost identical but aren't tied to a selected item.

If you could explain a little bit more about what you're trying to do someone might have a better solution that more closely follows the UI guidelines.

Re: Programatically open context menu - possible?

I do realize that I'm breaking some UI guidelines with my design, but sometimes you can't go by the book. Basically I have a landscape app, and I need to use whole available space. Using normal actions would make nav bar be always visible in the bottom, which takes a lot of space in landscape orientation, and also would ruin my design.

So what I did was place a "..." (more) button, which upon pressing presents extra options for current screen. I wanted to use context-menu facility as it comes out from right side (makes sense in landscape), and can hold actions. Perfect match for my needs, except it only works on long-press.

I ended up implementing my own fake menu that slides in from right upon button press, but it would be nice if I could have utilize built-in features, even if not in their intended way.

Re: Programatically open context menu - possible?

fyi - I believe it should be possible to auto-hide the actionbar, if that makes a difference to your design.

I know what you mean about the context-menu - I was in a similar scenario myself. I ended up implementing my own custom dialog instead (based on the SystemToast with buttons design) that prompts for user input that way. It actually turned out pretty well, but I can see how in some circumstances it'd be nice to pop open the context menu as well