开发者

Htc - I can't handle keyevent

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜