开发者

Capturing Android soft key events

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜