Android: making a fullscreen application

后端 未结 13 2022
北恋
北恋 2020-11-30 00:31

What is the simplest change that I can make to a new Blank Activity, as created by the latest version of Android Studio, to get the app to appear fullscreen?

I want

13条回答
  •  忘掉有多难
    2020-11-30 01:10

    Add these to Activity of your application.

    Android JAVA

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

    ;

    Android Kotlin

    supportActionBar?.hide()
    window.setFlags(
    WindowManager.LayoutParams.FLAG_FULLSCREEN,
    WindowManager.LayoutParams.FLAG_FULLSCREEN
    )
    

提交回复
热议问题