Android setOnEditorActionListener() 不触发
我正在尝试将侦听器设置为何时按下Enter按钮。但它根本没有开火。我在LG Nexus 4和Android 4.2.2上进行了测试。 适用于Android 2.3的Amazon Kindle Fire,无处可用!我也无法为按钮设置文本。下面是代码:EditText
setOnEditorActionListener
setImeActionLabel
Enter
mEditText.setImeActionLabel("Reply", EditorInfo.IME_ACTION_UNSPECIFIED);
mEditText.setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId,
KeyEvent event) {
Log.d("TEST RESPONSE", "Action ID = " + actionId + "KeyEvent = " + event);
return true;
}
});
我做错了什么?我该如何解决这个问题?