KeyEvents

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

KeyEvents

Postby timweicker » Wed Jun 17, 2009 4:52 pm

Hey there!


I got a simple question:

I would like to add two buttons to my layout. One "right-click"-button, one "left-click"-button. If the user presses one of the buttons, I would like the Android to handle it as if he had pressed the left-arrow-key or the right-arrow-key on his Android. How do I realize that?


Regards,
Tim
timweicker
Junior Developer
Junior Developer
 
Posts: 20
Joined: Wed Jun 10, 2009 7:55 pm

Top

Postby swordi » Wed Jun 17, 2009 6:04 pm

i would give the buttons a onclicklistener and in this listerner i would check which button was pressed

then you can call the method for right or left
swordi
Developer
Developer
 
Posts: 46
Joined: Tue May 19, 2009 9:44 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot] and 3 guests