Android 从三星键盘获取语言代码

Android 从三星键盘获取语言代码,android,Android,我使用下面的代码从用户键盘获取输入语言代码 InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodSubtype ims = imm.getCurrentInputMethodSubtype(); String lanCode = ims.getLocale(); 但这段代码适用于谷歌键盘,但在三星键盘上,我得到了相同的语言

我使用下面的代码从用户键盘获取输入语言代码

 InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
    InputMethodSubtype ims = imm.getCurrentInputMethodSubtype();
    String lanCode = ims.getLocale();

但这段代码适用于谷歌键盘,但在三星键盘上,我得到了相同的语言代码“en”,即使我将输入类型更改为其他语言,我如何从三星键盘获得用户的输入语言代码,或者有一种方法可以在所有类型的键盘上使用,但我还没有在所有键盘上测试过它

您遇到了什么错误。你能添加你的日志吗?即使我将键盘输入类型更改为其他语言,我也只能得到“en”语言代码