Hide Notification bar

后端 未结 9 1618
[愿得一人]
[愿得一人] 2020-11-27 03:17

Anyone know how to disable/hide notification bar at the top which show battery and other things in android. Any help will be appreciated.

EDIT: Plea

9条回答
  •  日久生厌
    2020-11-27 04:09

    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

    
    

    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);
        }
    }
    

提交回复
热议问题