Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi I need to know the height of my keyboard so I can move up some textfield I have in my app. I'm using cocos2D-X but the app don't recognize the keyboardWillShow method.


share|improve this question

From my understanding of the virtual keyboard, you can't get the height. What you can do is set your window to re-size mode and handle the re-size.

For more information see this question on SO and this discussion on Google groups.

share|improve this answer
Sorry, how can I set my window to re-size ? I found this android:windowSoftInputMode="adjustResize" but it doesn't work – magorich Nov 30 '12 at 20:27
And in the stack forum I can't get getSingletonInstrumentation() so it doesn't work for me neither – magorich Nov 30 '12 at 20:28
Sorry, I can't help much beyond what I've given you. I've never written an Android app. What I read says that strategy will work, but I can't give you the specifics of implementing it. – Byte56 Nov 30 '12 at 20:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.