How to disabled/hide the top status bar (battery status etc.

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

How to disabled/hide the top status bar (battery status etc.

Postby weixubin » Sat Mar 08, 2008 12:11 pm

have been looking in the Android APIs for a way to hide the top bar
(the one with the Battery status icon, along some other status icons),
but I haven't been able to find anything on this.


We can hide the Application title using the Activity
requestWindowFeature( Window.FEATURE_NOT_TITLE );


But besides this, I would also like to hide the Top Bar !
weixubin
Freshman
Freshman
 
Posts: 4
Joined: Sat Mar 08, 2008 12:05 pm

Top

Postby plusminus » Sat Mar 08, 2008 5:43 pm

Hello weixubin,

this way, to hide the StatusBar too (untested bur should be working):
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.    /** Called when the activity is first created. */
  2.  
  3.   @Override
  4.  
  5.   public void onCreate(Bundle icicle) {
  6.  
  7.     super.onCreate(icicle);
  8.  
  9.     // *******************************************
  10.  
  11.     // fullscreen mode
  12.  
  13.     // *******************************************
  14.  
  15.     requestWindowFeature(Window.FEATURE_NO_TITLE);
  16.  
  17.  
  18.  
  19.     getWindow().setFlags(WindowManager.LayoutParams.NO_STATUS_BAR_FLAG,
  20.  
  21.                    WindowManager.LayoutParams.NO_STATUS_BAR_FLAG);
  22.  
  23.     // *******************************************
  24.  
  25.     setContentView(R.layout.main);
  26.  
  27.   }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


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 tabrej.khan » Sun Dec 07, 2008 11:18 am

Following is working fine in SDK 1.0:

public void setFullscreen() {
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}

public void setNoTitle() {
requestWindowFeature(Window.FEATURE_NO_TITLE);
}

http://www.anddev.org/solved_how_to_dra ... -t244.html
User avatar
tabrej.khan
Freshman
Freshman
 
Posts: 8
Joined: Wed Jul 16, 2008 6:16 am
Location: Bangalore, Karnataka

Postby MrSnowflake » Sun Dec 07, 2008 1:52 pm

Thanks for pointing this out, but this is a 9 month old topic, so you probably are way to late, so please do not revive such old topics.

And the sollution is actually in a Code Snippet :).

But as I said: Thanks for trying to help other people too!
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 7 guests