full screen application android

后端 未结 8 754
暖寄归人
暖寄归人 2020-12-06 02:08

i have two questions:

  1. one how can i run my application in full screen
  2. how video players run videos in full screen.

i have tried alot an

8条回答
  •  感情败类
    2020-12-06 02:13

    Video Players run in full screen by setting the

    myView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

    setFlags() before setContentView(View)

    This will show the system bar on any user interaction, just like video players do.

    The closest you can get to running your app full screen is by setting in Lights Out mode, the system buttons will appear as dots.

    To use the lights out mode just use any view in your activity and call

    anyView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

    For Hiding the navigation bar use this in your onStart() so that every time you get to that activity it will be in full screen mode.

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

    I hope this helps !

提交回复
热议问题