如圖,用戶輸入網址后,需要點擊“瀏覽”按鈕才能訪問,輸入法中有個“前往”按鍵點了沒用,我如何才能捕獲用戶點擊“前往”按鍵這個事件呢?
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 關注
- 2092 瀏覽
添加回答
舉報
0/150
提交
取消