Created
February 23, 2015 14:27
-
-
Save vincent1086/e2017debeb54c2e18374 to your computer and use it in GitHub Desktop.
Android Keyboard IME Detected
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
public class CustomEditText extends EditText { | |
private KeyImeChange keyImeChangeListener; | |
public ListenerEditText(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} | |
public void setKeyImeChangeListener(KeyImeChange listener){ | |
keyImeChangeListener = listener; | |
} | |
public interface KeyImeChange { | |
public boolean onKeyIme(int keyCode, KeyEvent event); | |
} | |
@Override | |
public boolean onKeyPreIme (int keyCode, KeyEvent event){ | |
if(keyImeChangeListener != null){ | |
return keyImeChangeListener.onKeyIme(keyCode, event); | |
} | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment