packages/apps/Launcher3/src/com/android/launcher3/ExtendedEditText.java
@Override
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();
+ clearFocus();
}
if (mBackKeyListener != null) {
return mBackKeyListener.onBackKey();
}
return false;
}
return super.onKeyPreIme(keyCode, event);
}
Android 返回键无法退出搜索栏
最新推荐文章于 2024-08-23 11:30:03 发布