Anup Rojekar
Anup Rojekar

Reputation: 1103

Is it possible to add shortcut key to button in app?

I wrote an application with the multiple screens, one of the screen is LoginScreen containing two TextView's two EditText's & two Buttons,

my question is, is it possible to add a shortcut key for Button when you device has hard keyboard present.

Best Regards, Anup

Upvotes: 1

Views: 317

Answers (1)

Aleadam
Aleadam

Reputation: 40401

You can implement onKeyListener to your Activity and use it to simulate a click event on the button ( button.performClick(); )

Take a look here: http://developer.android.com/guide/topics/ui/ui-events.html
and here: http://developer.android.com/reference/android/view/View.html#performClick%28%29

Upvotes: 1

Related Questions