08-06-2009 05:05 AM
I have created a UiApplication. My all screens extends NewMainScreen where
NewMainScreen extends MainScreen
My new MainScreen constructor is
where manager is a instance of
NewVerticalFieldManager manager = new NewVerticalFieldManager( Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR | VerticalFieldManager.USE_ALL_WIDTH | VerticalFieldManager.USE_ALL_HEIGHT)
NewVerticalFieldManager extends VerticalFieldManager.. I have done this to render a Background image.
The application works fine on all the device but in case of Storm when you tilt the Device to lanscape mode...My application still remains in the portrait mode. How can I make my application run in both the mode depending on the orientation of the device i.e Portrait and Lanscape
08-06-2009 05:24 AM - edited 08-06-2009 05:28 AM
I know that method, but its only in 4.7 and I have made application for 4.2 and above.
There is no generalised way to achieve that functionality...
08-06-2009 05:42 AM
Yup I am already using a pre processor.... But I want a single build i.e single cod to work on all devices....
Here I will have to make 2 builds i.e 4.2 - 4.6 and one build for 4.7 n above...
08-06-2009 07:05 AM
I have used phone listener to get the application on the foreground....
If i dont use the phone call to get the application to the foreground the application and if I click the application icon from Download folder the application works perfectly in both portrait and landscape mode.
How can I make the application run in lanscape and portrait mode when i get the application to foreground using phone listener
Code to get the application to foreground is
08-06-2009 08:22 AM
ok , in that case, u need to do your layout programming in such a way that, it will depend on the Graphics.getScreenWidth() for all UI components. when you change the Orientation(landscape and portrait) of screen, layout of the fields gets called so there you can write some logic so that it will look good for both orientations.
By using preprocessors u cannot create 1 build so that is out of question.
08-06-2009 08:43 AM - edited 08-06-2009 08:45 AM
This will be very complicated...The application is running perfectly in Portrait and Landscape mode if i click the icon of the application. But when i dial a number and get the application to foreground the application does not work in landscape and
portrait mode both, it is only working in Portrait mode even if you tilt the device. The PhoneListener in blackberry works outside the scope of the application. Due to this the application doesnt seem get its orientation property. Is there any way by which I can enable the Orientation property of the application and set it to the new UIScreen pushed to the foreground.
08-07-2009 06:53 AM
Portrait and Landscape mode is working properly if the application is opened using SMS command.
Problem is only when the application is opened using the PhoneListener. Any suggestion how to make the application work
in both mode if the application is opened through phonelistener.
08-07-2009 07:04 AM
Not sure though.....
try overriding activate() method,
See if it works?
As when we call setForeground() if application is already in foregraound it does nothing, and setForeground() actually calls the activate() method of Application class. try sending application to background and again bringing it to the foregraound....
I have not tried just a suggestion,