user264953
user264953

Reputation: 1967

Capturing Android soft key events

I have two edittexts 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

Upvotes: 0

Views: 1127

Answers (1)

N-JOY
N-JOY

Reputation: 7635

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

Upvotes: 1

Related Questions