Reputation: 2182
I want to programattically handle the ENTER key in android. Is there any way to achieve this? Please Help!!
Thanks in advance
Upvotes: 1
Views: 3043
Reputation: 11038
You need to carefully override the following function:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_ENTER:
{
//your Action code
return true;
}
}
return super.onKeyDown(keyCode, event);
}
Upvotes: 2