editText.setOnEditorActionListener
2017-12-11 13:49
441 查看
editText.setOnEditorActionListener(new OnEditorActionListener(){
@Override
public boolean onEditorAction(TextView v,int actionId,KeyEvent event){
return false;
}
});
编辑完成后点击软件盘回车键触发.
查阅android sdk说明
/**
* Set a special listener to be called when an action is performed
* on the text view. This will be called when the enter key is pressed,
* or when an action supplied to the IME is selected by the user. Setting
* this means that the normal hard key event will not insert a newline
* into the text view, even if it is multi-line; holding down the ALT
* modifier will, however, allow the user to insert a newline character.
*/
设置在文本视图上执行操作时调用的特殊侦听器。
当按下enter键时,或当向IME提供的操作被用户选中时,将调用此操作。
设置这意味着正常的硬键事件不会在文本视图中插入新行,即使它是多行的;
然而,按住ALT修饰符将允许用户插入换行符。
@Override
public boolean onEditorAction(TextView v,int actionId,KeyEvent event){
return false;
}
});
编辑完成后点击软件盘回车键触发.
查阅android sdk说明
/**
* Set a special listener to be called when an action is performed
* on the text view. This will be called when the enter key is pressed,
* or when an action supplied to the IME is selected by the user. Setting
* this means that the normal hard key event will not insert a newline
* into the text view, even if it is multi-line; holding down the ALT
* modifier will, however, allow the user to insert a newline character.
*/
设置在文本视图上执行操作时调用的特殊侦听器。
当按下enter键时,或当向IME提供的操作被用户选中时,将调用此操作。
设置这意味着正常的硬键事件不会在文本视图中插入新行,即使它是多行的;
然而,按住ALT修饰符将允许用户插入换行符。
相关文章推荐
- (转)控件EditText的setOnEditorActionListener方法的理解
- android控件EditText的setOnEditorActionListener方法理解
- Android EditText中的setOnEditorActionListener方法的理解
- EditText监听事件setOnEditorActionListener onEditorAction执行两次
- 控件EditText的setOnEditorActionListener方法的理解
- Android 控件EditText的setOnEditorActionListener方法的理解
- 控件EditText的setOnEditorActionListener方法的理解
- 控件EditText的setOnEditorActionListener方法的使用
- EditText、requestFocus、imeOptions、TextWatcher、setOnEditorActionListener
- 控件EditText的setOnEditorActionListener方法的理解
- edittext的setOnKeyListener里面的方法响应两次的原因和解决方法
- EditText中onEditorAction监听事件执行两次
- TextView不能响应setOnTouchListener ACTION_DOWN的解决方法
- Android EditText setOnClickListener事件 只有获取焦点才能响应 采用setOnTouchListener解决
- Android EditText setOnClickListener事件 只有获取焦点才能响应 采用setOnTouchListener解决
- 三星手机上,setOnEditorActionListener软键盘监听回车无效,解决方案
- Android EditText setOnClickListener事件 只有获取焦点才能响应 采用setOnTouchListener解决
- android之EditText文本监听(addTextChangedListener)
- android EditText长按屏蔽ActionMode context菜单但保留选择工具功能
- EditText 可以相应setOnClickListener但是不响应addTextChangedListener