You can use InputMethodManager
to get the list of enabled InputMethodInfo
and iterate over it to find out if your InputMethod
is enabled or not.
public boolean isMyInputMethodEnabled() {
boolean isEnabled = false;
InputMethodManager inputMethodManager
= (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
List<InputMethodInfo> inputMethodList = inputMethodManager
.getEnabledInputMethodList();
for (InputMethodInfo inputMethodInfo : inputMethodList) {
if (inputMethodInfo.getPackageName().equals(getPackageName())) {
isEnabled = true;
break;
}
}
return isEnabled;
}