user interface - onKeyDown not always called in Android app -


I have created a simple Android game, which is based on the Moon Lander spec, and I have a problem assuming the key. When the activity starts, the only key to call on the Kikadadown or onKeyUp is the DPD up / down / left / right keys. Keys, back or DPAD_ keys are not triggered in any way, however, once I have a diapad up / Down / left / right button, push these methods by pressing the keys of the menu, back or DPAD_ center I am not getting any error, or there is no indication of what's going on wrong.

It is possible that the focus is set incorrectly - the activity has been started with a button on the screen, so it can be in touchscreen mode. If this is the case, then touching the back button should move me in the correct focus mode so that I can hold the event?

I am using the emulator from SDK-1.5 R3. I have not been able to try it on a real phone yet. Here's my Kidadown.

  Public Boolean On Kidadown (Int kikod, Key Event Message) {Log D. ("Tag, On Kidadown:" + + Keycode); Return Super. Kondown (keycode, msg); }  

thanks

matte

Is it on Kednendown in any scene or activity?

If setContentView is said to pass in a view, and if that view is set (true) it is called on, then all major events will bypass the event and go straight into the scene.

On the other hand, if your on Kidadown is in view, and you have not asked the content view set on the activity and set the set to the Focus, do not see major events in your activity and see.

Look for those specific calls, but I think you are the subject of focus about it.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -