Hide Notification Bar

How to hide status bar in android in just one activity

If you want to remove status bar then use this before setContentView(layout) in onCreateView method

    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

credits

Hide Notification bar

You could use a theme in your AndroidManifest.xml:

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

or change parent of your AppTheme to @android:style/Theme.NoTitleBar.Fullscreen like this

<style name="AppTheme" parent="Theme.NoTitleBar.Fullscreen">
</style>

then apply this theme on activities which you want Fullscreen like

android:theme="@style/AppTheme"

or use the following code snippet:

public class FullScreen
extends android.app.Activity
{
@Override
public void onCreate(android.os.Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

setContentView(R.layout.main);
}
}

How to hide Android StatusBar in Flutter

SystemChrome.setEnabledSystemUIOverlays([]) should do what you want.

You can bring it back with SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values).

Import it using

import 'package:flutter/services.dart';

Update answer (from Flutter 2.5 or latest):

SystemChrome.setEnabledSystemUIMode(SystemUiMode.leanBack);

Or you can use another options like:

SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [
SystemUiOverlay.bottom
]); // to hide only bottom bar

Then when you need to re-show it (like when dispose) use this:

  @override
void dispose() {
super.dispose();

SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: SystemUiOverlay.values); // to re-show bars

}


Related Topics



Leave a reply



Submit