Show menu programmatically

Put your problem here if it does not fit any of the other categories.

Show menu programmatically

Postby AndreySerj » Fri Dec 28, 2007 10:57 am

Is it possible to show menu programmatically? For example by double-click on list item.
AndreySerj
Developer
Developer
 
Posts: 31
Joined: Wed Dec 26, 2007 9:57 am
Location: Minsk

Top

Postby Rizwan » Fri Dec 28, 2007 4:02 pm

Yeah I m looking for samething is it possible to call Eventhandler from another Eventhandler in Android ?
Rizwan
Junior Developer
Junior Developer
 
Posts: 18
Joined: Sun Dec 16, 2007 6:35 pm

Postby plusminus » Fri Dec 28, 2007 4:43 pm

Hey guys,

you mean a popupmenu or the menu which is normally accessed via the Menu-Button on the Device :?:

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby AndreySerj » Fri Dec 28, 2007 4:45 pm

I mean menu which is accessed via the Menu-Button on the Device :)
AndreySerj
Developer
Developer
 
Posts: 31
Joined: Wed Dec 26, 2007 9:57 am
Location: Minsk

Postby cabernet1976 » Sat Dec 29, 2007 3:49 am

AndreySerj's meaning is to trigger an event (e.g. some special Intent in Android) which equals user press the menu button in the phone. right :?:
I spend some time to dig the document, but find nothing. :oops:
Interesting...
Upload2Flickr's blog: http://upload2flickr.blogspot.com
cabernet1976
Senior Developer
Senior Developer
 
Posts: 154
Joined: Fri Nov 16, 2007 2:34 am
Location: China

Postby cabernet1976 » Wed Jan 09, 2008 6:57 am

It should be the solution: :arrow: http://groups.google.com/group/android- ... 5f430d8f84

:) :P :D

[Edit by plusminus]
Link contains this code-snippet:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Activity.getWindow().openPanel(Window.FEATURE_OPTIONS_PANEL, event)
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

[/Edit]
Upload2Flickr's blog: http://upload2flickr.blogspot.com
cabernet1976
Senior Developer
Senior Developer
 
Posts: 154
Joined: Fri Nov 16, 2007 2:34 am
Location: China

Top

Postby AndreySerj » Wed Jan 09, 2008 12:36 pm

I have a next solution:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. IWindowManager wManager = IWindowManager.Stub.asInterface(ServiceManager.getService("window"));
  3.  
  4.  
  5.  
  6. KeyEvent kd = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_SOFT_LEFT);
  7.  
  8. KeyEvent ku = new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_SOFT_LEFT);
  9.  
  10.  
  11.  
  12. ...
  13.  
  14. wManager.injectKeyEvent(kd.isDown(), kd.getKeyCode(), kd.getRepeatCount(), kd.getDownTime(), kd.getEventTime(), true);
  15.  
  16. ...
  17.  
  18.  
  19.  
  20.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
AndreySerj
Developer
Developer
 
Posts: 31
Joined: Wed Dec 26, 2007 9:57 am
Location: Minsk

Postby plusminus » Wed Jan 09, 2008 5:44 pm

Hey guys,

thanks for sharing your snippets :)

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 19 guests