仅供参考,这是我在StackOverflow上的第一个问题,我还是个新手.
在处理一个完全是Kotlin(版本1.1.3-2)的项目时,我在以下代码中看到一条警告(带给好奇的小伙子们的注释):
// Code below is to handle presses of Volume up or Volume down.
// Without this, after pressing volume buttons, the navigation bar will
// show up and won't hide
val decorView = window.decorView
decorView
.setOnSystemUiVisibilityChangeListener { visibility ->
if (visibility and View.SYSTEM_UI_FLAG_FULLSCREEN === 0) {
decorView.systemUiVisibility = flags
}
}
The warning is for visibility and View.SYSTEM_UI_FLAG_FULLSCREEN === 0, and it says Identity equality for arguments of types Int and Int is deprecated.
我应该如何更改代码,为什么它一开始就被弃用(出于了解的原因)?