Hide Notification bar

后端 未结 9 1583
[愿得一人]
[愿得一人] 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 03:58

    This answer is for android developers who like minimalist and simplified one-liner code. If you intend to only hide notification bar, use this code:

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

    be careful to put it before setContentView() in your on create() function of required activity.class

提交回复
热议问题