Merge "When KEYCODE_BACK is received, hide keyboard" into sc-dev
This commit is contained in:
commit
24c8ebd88d
|
@ -70,6 +70,9 @@ public class ExtendedEditText extends EditText {
|
|||
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
|
||||
// If this is a back key, propagate the key back to the listener
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) {
|
||||
if (TextUtils.isEmpty(getText())) {
|
||||
hideKeyboard();
|
||||
}
|
||||
if (mBackKeyListener != null) {
|
||||
return mBackKeyListener.onBackKey();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue