android activity sets up no title to achieve full screen

  • 2020-05-07 20:22:34
  • OfStack

Activity full screen and no title bar, andorid.view.Window and Android.view.WindowManager. Window.FEATURE_NO_TITLE means no title bar.
WindowManager.LayoutParams.FLAG_FULLSCREEN means full screen.

is used as :
1. The following code can be used to set the full screen:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
2. The following code can be used to set title bar without title:
requestWindowFeature(Window.FEATURE_NO_TITLE);
3. Place these code snippets before setContentView in your Activity.

Related articles: