Android set default keyboard

佐手、 提交于 2019-12-24 21:42:40

问题


i want to set scandinavian keyboard as default keyboard on an android device and i want to do this by code. So i try with InputMethodManager :

InputMethodManager mng = (InputMethodManager)getSystemService(LoginActivity.INPUT_METHOD_SERVICE);
List<InputMethodInfo> m_list=mng.getInputMethodList();

and i find the method setInputMethod (IBinder token, String id) of the InputMethodManager class. But i don't find examples/documentation that explain me how to use it.Any suggestion? Thanks.


回答1:


Hi everybody, i want to set scandinavian keyboard as default keyboard on an android device and i want to do this by code.

You cannot modify the "default keyboard on an android device" via code from a standard SDK application. The user can choose their own keyboard and locale via the Settings application. You can send users to the proper Settings screen via ACTION_INPUT_METHOD_SETTINGS and ACTION_LOCALE_SETTINGS, which are activity Intent actions defined on android.provider.Settings.

Applications that are part of the device firmware can use DEFAULT_INPUT_METHOD on android.provider.Settings.Secure.



来源:https://stackoverflow.com/questions/3916184/android-set-default-keyboard

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