开发者

Capturing Android soft key events

开发者 https://www.devze.com 2023-02-04 07:37 出处:网络
I have two edit开发者_开发知识库texts and a button in my layout.When I press the \'done\' key in softkeyboard, I need to catch that key event and perform null checking for these edit fields.Can anyone

I have two edit开发者_开发知识库texts and a button in my layout.When I press the 'done' key in softkeyboard, I need to catch that key event and perform null checking for these edit fields.Can anyone kindly help me on this?

BR, Rony


public boolean onKeyDown(int keyCode, KeyEvent event) {  
    if(keyCode==KeyEvent.KEYCODE_ENTER)
    {  
        check for null;
    }
    return(super.onKeyDown(keyCode, event));  
}
0

精彩评论

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

关注公众号