views:

282

answers:

2

Hi,

have developed an app for BB storm while tilting the device the background image of the app screen does not matches with the screen size, i have tried with the sublayout method

public void sublayout(int width, int height)
{
    //update scrren layout based on orientation
    if(Display.getOrientation()== Display.ORIENTATION_LANDSCAPE)
    {
    invalidate();
    }
    else if(Display.getOrientation()== Display.ORIENTATION_PORTRAIT)
    {
     invalidate();
    }

    super.sublayout(width, height);
}

Still not successfull can any one help to sort out this tilt issue in BB storm

Thanks SujithRavindran Rapidvaluesolutions

A: 

You are calling invalidate() but not doing anything to change the actual background image. You'll probably want to change the image for your BitmapField (or whatever you're using for the background), and then call invalidate().

Marc Novakowski
A: 

You don't need to call invalidate() as part of your sublayout method. Layout happens first, and then your screen is automatically invalidated by the system.

Also, updating the layout in your sublayout method will trigger a second layout.

Bradley