mKeywordEt.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
}
return true;
}
});
@Override
public boolean onEditorAction(TextView arg0, int arg1, KeyEvent arg2) {
/**
arg2.getAction() == KeyEvent.ACTION_UP 这个判断要加上,因为回车事件 有按下和松开,不加上这句会执行两次onEditorAction
**/
if(arg1 == EditorInfo.IME_ACTION_UNSPECIFIED && arg2.getAction() == KeyEvent.ACTION_UP){
}
return true;
}
});