0

I am developing a app which is running on a Android 10 dedicated device. Added the follow code but when swipe still show as pic, how do I totally disable action bar and navigation bar without root the device?

  override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        hideSystemUI()

        window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
    }
    private fun hideSystemUI() {
        window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
                // content doesn't resize when the system bars hide and show.
                or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                // Hide the nav bar and status bar
                or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                or View.SYSTEM_UI_FLAG_FULLSCREEN)
    }

disabled bar but still shown

JamesKing
  • 33
  • 5
  • Change the theme of activity in the manifest https://stackoverflow.com/questions/26492522/how-do-i-remove-the-title-bar-in-android-studio – Goodie123 Jun 06 '20 at 06:17
  • @Goodie123 Thank you for the link, set up as it said, but still show the status bar and the navigation bar. – JamesKing Jun 06 '20 at 07:22

0 Answers0