I make code to Blackberry Storm. When my application in horizontal display (480×360), it’s work. But when the Blackberry tilt into Vertical (360×480), the picture is cut off. So I was asking how to set up so that at the time of rotation, also resize the picture? is there any method to check if BlackBerry again horizontal or vertical display?
Thanks.
Here are two things, either you will lock screen orientation or you will support in your application.
Code sample: Retrieving screen orientation
Code sample: Forcing portrait view in a BlackBerry API application
You you want to handle the images and other graphics setup on orientation change then you can do the following changes in your code.
Override the sublayout method, in your MainScreen subclass.
protected void sublayout(int arg0, int arg1) {
// do all the
super.sublayout(arg0, arg1);
}
Check for the orientation changes, rearrange the UI. Usages of relative layout is recommended for such things.
Hope, this might help you out. For more info visit Specifying_display_direction_of_screen
Edit: override sublayout() and then write the code specific to orientation
Edit 2:
you were going wrong because of UI event lock, now you do the following changes to your code.