如图,用户输入网址后,需要点击“浏览”按钮才能访问,输入法中有个“前往”按键点了没用,我如何才能捕获用户点击“前往”按键这个事件呢?
3 回答
妇芳单身骗
TA贡献1条经验 获得超1个赞
这地方真冷清,自问自答吧
editText.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { switch (actionId) { case EditorInfo.IME_ACTION_DONE: case EditorInfo.IME_ACTION_GO: case EditorInfo.IME_ACTION_NEXT: case EditorInfo.IME_ACTION_SEARCH: case EditorInfo.IME_ACTION_SEND: what_you_want_to_do(); return true; } return false; } });
- 3 回答
- 0 关注
- 1946 浏览
添加回答
举报
0/150
提交
取消