Htc - 我无法处理按键事件
我在屏幕上有一个编辑文本。我想做一些按钮完成的事情。在 google Nexus s 、三星 Galaxy 上运行完美。键盘上的按钮显示为“完成”文本。在 htc 上,该按钮不会出现,而是显示输入 simbol。我尝试在代码或子句中添加广告来处理事件输入,但它没有响应
edit1.setImeOptions(EditorInfo.IME_ACTION_DONE);
edit1.setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView arg0, int arg1, KeyEvent arg2) {
if (arg1 == EditorInfo.IME_ACTION_DONE) {
chercher.performClick();
}
return true;
}
});
提前致谢, 拉卢卡
I have in a screen an edit text. I want to do something button done . On google nexus s , samsung galaxy it works perfect. On keyboard the button appears with text "done". On htc the button does not appears it appear enter simbol. I ve tried to ad in code or clause to treat event enter but it does not respond
edit1.setImeOptions(EditorInfo.IME_ACTION_DONE);
edit1.setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView arg0, int arg1, KeyEvent arg2) {
if (arg1 == EditorInfo.IME_ACTION_DONE) {
chercher.performClick();
}
return true;
}
});
Thanks in advance,
Raluca
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AFAIK,IME 操作在不同设备供应商之间并不一致。我的建议是保留您的侦听器,并在您的设计中提供一个按钮,以防侦听器不触发。
AFAIK, IME Actions are not consistant across device vendors. My advice would be to keep your listener and also make a provision in your design to have a button in case the listener doesn't fire.