Unfortunately you cannot catch the input method which user picks in InputMethodPicker
.
However, you can check it after user picks it, using BroadcastReceiver
.
When IME changes, Intent.ACTION_INPUT_METHOD_CHANGED
will be broadcasted.
public class InputMethodChangeReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_INPUT_METHOD_CHANGED)) {
.....
/* You can check the package name of current IME here.*/
}
}
}
Then, register it.
IntentFilter filter = new IntentFilter(Intent.ACTION_INPUT_METHOD_CHANGED);
registerReceiver(mReceiver, filter);