I have to get currently selected keyboard language in android. So far I am using this:
InputMethodManager imm = (InputMethodManager)getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
InputMethodSubtype ims = imm.getCurrentInputMethodSubtype();
if(ims != null)
{
String lName = ims.getLocale();
Locale locale = new Locale(lName);
String lang = locale.getLanguage();
}
but Samsung keyboard and Swiftkey keyboard always return device's language, not the selected keyboard language. And on Swiftkey when the device's language is different from English it returns something like that for all languages:
"it_it", "ru_ru", "bg_bg"
How to get the current keyboard language properly?