android 全屏切换到非全屏 页面抖动

解决办法:

    在全屏的activity finish之前手动退出全屏

window.setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)

finish()

另外,要记得实现物理返回键的回调,需要在onBackPressed()回调函数中,退出全屏
override fun onBackPressed() {

        window.setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)

        super.onBackPressed()

    }

你可能感兴趣的:(Android)