Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
08-17-2010 04:24 AM
I am using a 9530 to do development. there is a peculiar behaviour for my application. I will try to summarize
1. display main screen A
2. select option to display another screen B
3. pop screen B and push screen A, after input of data
4. Display.getHeight() when re-initializing the content of screen A returns the height of screen B instead of screen A.
This is a problem as screen B has a keyboard, for user input, so Display.getHeight returns half of the actual screen size. I tried Display.getVerticalResolution() and it returns me a constant value. But it is in pixels.
Do i add on the keyboard height? Or is there anyway for me to get the full height by some other function?
08-17-2010 04:47 AM
That sounds like it still thinks screen B is being displayed.
Could you cache the height of the screen in your class for screen A and use the cached value rather than asking the OS for the height?
08-17-2010 05:31 AM
i can do that but it would not be a very good method to implement. especially if i were to tilt the device etc. Currently i'm getting the model for the device and then using hardcoded values as a workaround. Anyone got any ideas?
08-17-2010 05:45 AM
I agree, its not a very good method for the reasons you state. You would have to re-query the dimensions when the device rotates to get the new screen dimensions.
It sounds like your code still thinks the wrong screen is being displayed. Do you have any sample code?
08-17-2010 08:19 PM
This method lies in my Util class to retrieve the Display height
public static int getScreenHeight()
int ht = Display.getHeight();
The code below lies in my screen B. The variable prevScreen referes to screen A.
if (null != prevScreen)
After this is done, when i do a Util.getScreenHeight() , it returns me the height of screen B, taking the height of the keyboard into account.