Change Android KeyBoard language

后端 未结 2 940
忘掉有多难
忘掉有多难 2020-12-06 06:18

How to change Android Keyboard language?

I have set below code to set language. I set different language from Settings and trying to set English language.

         


        
2条回答
  •  悲&欢浪女
    2020-12-06 06:44

    (API 24+): If you are using a TextView/EditText, then you can call TextView#setImeHintLocales(LocaleList)

    textView.setImeHintLocales(new LocaleList(new Locale("zh", "CN")));
    

    Note: This works on very few keyboards (at the time of writing, GBoard works and SwiftKey doesn't).

    Note: If you want new "hint" to take effect immediately you need to call InputMethodManager#restartInput(View).

提交回复
热议问题