Fullscreen or No Title bar

Quickly share your Android Code Snippets here...

Fullscreen or No Title bar

Postby MrSnowflake » Mon Oct 13, 2008 10:39 am

Start a fullscreen Activity, or an Activity without a title bar, leaving only the notification area.
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.     public void setFullscreen() {
  3.  
  4.         requestWindowFeature(Window.FEATURE_NO_TITLE);
  5.  
  6.         getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
  7.  
  8.                 WindowManager.LayoutParams.FLAG_FULLSCREEN);
  9.  
  10.     }
  11.  
  12.    
  13.  
  14.     public void setNoTitle() {
  15.  
  16.         requestWindowFeature(Window.FEATURE_NO_TITLE);
  17.  
  18.     }
  19.  
  20.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

NOTE: Should be called before Activity.setContentView() or it will throw!
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: Yahoo [Bot] and 3 guests