我怎么能知道键盘语言? (EN / FR) [英] How can I know keyboard language? (en/fr)

查看:280
本文介绍了我怎么能知道键盘语言? (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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆