How to hide status bar
(phone icon,battery icon, network icon etc.) in android?
Asked
Active
Viewed 8,262 times
4

Confuse
- 5,646
- 7
- 36
- 58

user3168129
- 151
- 1
- 2
- 6
-
you want to do this when you are running your application? or throughtout when you are in the launcher? – Sagar Pilkhwal Sep 09 '14 at 11:30
-
2http://stackoverflow.com/questions/5431365/how-to-hide-status-bar-in-android – Metehan Sep 09 '14 at 11:30
3 Answers
4
Write this code just above setContentView(R.id.activity_main)
and it will work.
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);

Sagar Pilkhwal
- 3,998
- 2
- 25
- 77

Nithin
- 503
- 4
- 19
2
You can also change theme in Android Manifest
to hide the status bar such that you don't have to call the code in every activity.
<application
...
android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen" >
...
</application>
If you are not using Holo, you may need to change that slightly.
Alternatively, you can call this code in each activity -
For 4.0 and Lower
Add this in onCreate method before setContentView(R.layout.activity_main);
line.
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
For 4.1 and higher
View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

Confuse
- 5,646
- 7
- 36
- 58
1
In your manifest you can add android:theme="@android:style/Theme.NoTitleBar"
.
In your Activity you can add getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
Hope this will help you in finding your solution.

Nabasree Suvasourya
- 164
- 8