Prevent StatusBar from showing when using AlertDialog.Builder

前端 未结 5 818
半阙折子戏
半阙折子戏 2021-01-22 10:34

In the XML of my MainActivity, I have programmed it so that it uses a theme with NoActionBar and therefore there is no ac

5条回答
  •  一个人的身影
    2021-01-22 11:04

    Calling this method I've created at the Dialog's onCreate() fully resolved the problem of status bar show or show/hide.

    private void hideStatusBar(Window window) {
        window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
        window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
    

提交回复
热议问题