我怎么能知道键盘语言? (EN / FR) [英] How can I know keyboard language? (en/fr)
问题描述
我开发一个手机短信发送者的应用程序,我想知道的语言,用户使用。因此,当用户键入一个消息我怎么知道的语言,他/她用?
I develop an sms sender app and I wanna know language that user uses. so, when user types a message how can I know language that he/she uses?
推荐答案
通过使用获得输入类型管理器:
get the input type manager by using:
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
然后,选择它使用下一个方法来得到了什么:
then , choose what to get from it using the next methods :
<一个href="http://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html#getCurrentInputMethodSubtype%28%29">http://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html#getCurrentInputMethodSubtype%28%29
或: <一href="http://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html#getLastInputMethodSubtype()">http://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html#getLastInputMethodSubtype()
连同本以获得输入类型的语言环境:
together with this to get the locale of the input type:
<一个href="http://developer.android.com/reference/android/view/inputmethod/InputMethodSubtype.html#getLocale()">http://developer.android.com/reference/android/view/inputmethod/InputMethodSubtype.html#getLocale()
这篇关于我怎么能知道键盘语言? (EN / FR)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!