How programmatically switch to default softkeyboard

↘锁芯ラ 提交于 2019-12-11 12:33:20

问题


I have multiple keyboards on my device, how can I switch between the different keyboards programmatically?

(I don't want to simply open or close the soft keyboard as in: android - show soft keyboard on demand. I need to switch to the default keyboard.)

Edit: add code

If i try below code, i switch to current keyboard:

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

But i need switch to default keyboard.

Please get me any idea to switch to default keyboard?


回答1:


If you want to display the keyboard on edittext by default, here is how you can:

 yourEditText.requestFocus();


来源:https://stackoverflow.com/questions/13678258/how-programmatically-switch-to-default-softkeyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!