开发者

Htc - I can't handle keyevent

开发者 https://www.devze.com 2023-04-12 10:36 出处:网络
I have ina 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

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

精彩评论

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