05-06-2009 01:55 PM - edited 05-06-2009 02:00 PM
I am writing an application which needs to get the height of the screen on the storm and other blackberry models, so I am using the Display.getHeight() method.
I am however experiencing a problem with using this method on the storm in landscape mode. The problem happens when the current screen holds the virtual keyboard, and I then click the back button to go to the provious screen. After doing this, it returns to the previous screen (one that does not have the keyboard up), but it doesn't get drawn properly, as Display.getHeight() only returns the paintable space left as if they keyboard was still there (it isn't) - something around 130 instead of the full 360.I have tried to explicitly tell the keyboard to hide before and after going back and I still get the same value from Display.getHeight(). I have not experienced any problems in portrait mode, which leads me to believe this may be a problem with the API.
Is there another method that can be used instead, or is this a defect with RIM's api?
edit: Forgot to mention: when I go through the menu on the page on question, and show the keyboard, it shows up fine. After hiding it, however, the page does not redraw. I need to move my finger on the screen a little bit or press on something for the screen to draw correctly (this also fixes the problem sometimes on the problem described above).
05-07-2009 12:20 AM
Call invalidate() on the screen which is not painting properly.
Please let me know if it solved your prob;em or not.
03-18-2010 02:19 PM
I have had exactly the same problem - in two places.
Basically, Display.height is changed while the virtual keyboard is displayed - and then not restored after the keyboard goes away, for the screen active under the keyboard. It seems you need to pop the screen that had the keyboard. Ugly.