先设置edittext的imeOptions属性
然后设置edittextview的setOnEditorActionListener事件
1
| android:imeOptions= "actionDone" |
然后设置edittextview的setOnEditorActionListener事件
1
2
3
4
5
6
7
8
| edittext.setOnEditorActionListener( new OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_DONE) { // do something } return true ; }); |
评论
发表评论