Android show softkeyboard with showSoftInput is not working?

后端 未结 12 2167
抹茶落季
抹茶落季 2020-12-28 13:49

I have created a trivial application to test the following functionality. When my activity launches, it needs to be launched with the softkeyboard open.

My code doe

12条回答
  •  感动是毒
    2020-12-28 14:21

    This worked with me on a phone with hard keyboard:

    editText1.requestFocus();
    InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
              imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
    

提交回复
热议问题