Show soft keyboard even though a hardware keyboard is connected

后端 未结 5 1712
野性不改
野性不改 2020-12-05 07:44

Is there any way to show software keyboard with USB keyboard connected (in my case RFID reader)?
I tried to force show it using InputManager (with these or similar para

5条回答
  •  鱼传尺愫
    2020-12-05 08:05

    This worked in my app, interestingly, also an kiosk app.

    This is a bit stripped, I did some checks beforehand, whether IMM is null and such.

    ((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInputFromWindow(someInputView.getApplicationWindowToken(), InputMethodManager.SHOW_FORCED, 0);
    

提交回复
热议问题