我已经开发了一个使用webview的小型Android应用程序。所有Android UI元素,如通知栏、statusbar、actionbar都是通过以下方式隐藏的:
private void hideSystemUI() {
// Set the IMMERSIVE flag.
// Set the content to appear under the system bars so that the content
// doesn't resize when the system bars hide and show.
getWindow().getDecorView().s
当我按下Android手机上的back键时,它会关闭软键盘,但当我调用onbackpressed方法时,它不会关闭软键盘
我试图通过编程关闭软键盘,但我不能准确地解决问题
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
if (imm.isAcceptingText){
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0)
android.R.id.accessibilityActionH