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" >
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" >
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>
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);
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
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();