Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development


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.


Reply
Highlighted
Developer
Posts: 66
Registered: ‎08-21-2009
My Device: Not Specified

How to avoid screen resizing when virtual keyboard launched

Hi,

 

We are developing an application having screen with image in background and edit box. As soon as this screen displays, virtual keyboard gets launched (as default focus is on the edit box) and screen size gets changed due to which image in the background also gets shrinks (image gets disturbed).   

 

Is there any work around or way to avoid screen sizing when virtual keyboard gets launched.

 

- Krmlkr

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to avoid screen resizing when virtual keyboard launched

I presume you are using Display.getHeight() and Display.getWidth().

 

I recommend that you get these once, at application startup, and use this value where you need assets like images sized to the actual screen size. 

 

You may need to be careful if you are supporting the application tilting the screen, as the width becomes the height and vice versa. 

 

As I understand it, Display.getHeight() and Display.getWidth() are actually 'expensive' in terms of the resources required so doing this once is good practice.

 

If this doesn't help, look at how you are using sublayout in the Manager that you use to 'size' the background bitmap. 

 

Finally if you are resizing things like this, I recommend that you do it once at application start-up (say while your splash screen is displaying) and save the images.  This reduces the number of times you do this and may well reduce memory footprint, since images, especially background images, can be very large.