0

How can I hide the battery, connection, wi-fi ... etc (Status Bar) which are above on the top of the smartphone? I removed the title bar by

<application
    android:theme="@android:style/Theme.NoTitleBar" >
Mehmet K
  • 2,805
  • 1
  • 23
  • 35
SaherS
  • 15
  • 4

4 Answers4

1

style.xml:

<style name="AppTheme.NoTitle" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowContentOverlay">@null</item>
    </style>

AndroidManifest.xml:

<activity
    android:name=".FullScreenActivity"
    android:theme="@style/AppTheme.NoTitle"
>
</activity>
Vanraj Ghed
  • 1,261
  • 11
  • 23
0

Add these 2 lines inside onCreate method before setting content view:

requestWindowFeature(Window.FEATURE_NO_TITLE); 
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
Partharaj Deb
  • 864
  • 1
  • 8
  • 22
Shivanshu Verma
  • 609
  • 5
  • 19
0

If you want to hide the status bar on Android 4.0 and above do this

View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
// Remember that you should never show the action bar if the
// status bar is hidden, so hide that too if necessary.
ActionBar actionBar = getActionBar();
actionBar.hide();

Check out this link for more info https://developer.android.com/training/system-ui/status.html

Ankit Sharma
  • 663
  • 1
  • 5
  • 17
0

add this line in your onCreate()

setContentView(R.layout.activity_view_hotel_image);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getSupportActionBar().hide();
ND1010_
  • 3,743
  • 24
  • 41