" down"时清除TextView焦点。按下(隐藏键盘)按钮

时间:2016-05-21 20:52:41

标签: android user-interface textview

当用户通过按下" down"来更改用户隐藏键盘时执行的代码。按钮? (当后退按钮变换为向下箭头时)

1 个答案:

答案 0 :(得分:1)

你可以这样做,

@Override
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
  if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
    //Clear textview focus here
    return true;  
  }
  return super.dispatchKeyEvent(event);
}