Prevent StatusBar from showing when using AlertDialog.Builder

前端 未结 5 858
半阙折子戏
半阙折子戏 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:00

    For API Level 17 and up, see gprathour's answer.

    For API Level 16 and lower, the following line needed to be added to my Dialog's onCreate()

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

提交回复
热议问题