赞
踩
EditText实现Action 监听。
- mEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
- public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
- if (actionId == EditorInfo.IME_ACTION_GO || (event != null && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
-
- Toast.makeText(mContext, "go", Toast.LENGTH_SHORT).show();
- return true;
- }
- return false;
- }
- });
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。