Last active
February 21, 2018 14:51
-
-
Save marcosalis/ddeffd99a202077fced5981cfc4ad15c to your computer and use it in GitHub Desktop.
Android: Detect if Samsung keyboard is the current selected input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); | |
Field field = imm.getClass().getDeclaredField("mCurId"); | |
field.setAccessible(true); | |
String o = (String) field.get(imm); | |
if ("com.sec.android.inputmethod/.SamsungKeypad".equals(o)) { | |
isSamsungKeyboard = true; | |
} | |
} catch (Exception ignored) { // we failed | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment