Menu, Open, Programatically, Window.FEATURE_OPTIONS_PANEL

Quickly share your Android Code Snippets here...

Menu, Open, Programatically, Window.FEATURE_OPTIONS_PANEL

Postby plusminus » Sun Oct 12, 2008 11:53 pm

Put this snippet to any class that extends Activity:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         public void openMenu(){
  2.  
  3.                 this.getWindow().openPanel(Window.FEATURE_OPTIONS_PANEL,
  4.  
  5.                                 new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_MENU));
  6.  
  7.         }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


SDK Version compatible: at least: 1.0
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

Postby MaTriXy » Fri Nov 14, 2008 5:09 pm

You forgot

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. import android.view.KeyEvent;
  3.  
  4. import android.view.Window;
  5.  
  6.  
  7.  
  8.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
MaTriXy
Freshman
Freshman
 
Posts: 8
Joined: Sat Nov 01, 2008 1:04 pm

Postby plusminus » Fri Nov 14, 2008 5:18 pm

Yes usually I use:
Code: Select all
STRG + SHIFT + O

for Organizing Imports :-P
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 MrSnowflake » Fri Nov 14, 2008 6:30 pm

MaTriXy wrote:You forgot

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. import android.view.KeyEvent;
  2. import android.view.Window;
  3.  
  4.  
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
He forgot a lot more than only those imports :).
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Return to Code Snippets for Android

Who is online

Users browsing this forum: No registered users and 7 guests