1. sagare's Avatar
    Hi All,



    I am making an application for storm also my application can be launched from native call log screen.But when i launch from the native call log screen what i see is that i dont get the orientation change notifications.Basically i am using the sublayout method so that i can get the orientation change notification. Also what i see is the native call log screen itself in storm doesnt support orientation changes. Can anyone please help me on this?

    This is the code i used



    import net.rim.blackberry.api.menuitem.ApplicationMenuIte m;
    import net.rim.blackberry.api.menuitem.ApplicationMenuIte mRepository;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.component.RichTextField;
    import net.rim.device.api.ui.container.MainScreen;

    public class Bug49 extends UiApplication
    {
    public Bug49()
    {
    super();
    Bug49Screen screen = new Bug49Screen();
    pushScreen(screen);
    ApplicationMenuItemRepository amir = ApplicationMenuItemRepository.getInstance();
    Bug49NativeMenu bug49NativeMenu = new Bug49NativeMenu(0);
    amir.addMenuItem(ApplicationMenuItemRepository.MEN UITEM_PHONE, bug49NativeMenu );
    }

    public static void main(String[] args) {
    Bug49 b49 = new Bug49();
    b49.enterEventDispatcher();
    }

    static class Bug49Screen extends MainScreen {
    public Bug49Screen() {
    super();
    setTitle(new LabelField("Hello"));
    add(new RichTextField("Hello"));
    }

    protected void sublayout(int width, int height){
    System.out.println("Comes in SubLayOut**************************************");
    super.sublayout(width, height);
    }
    }

    static class Bug49NativeMenu extends ApplicationMenuItem
    {
    public Bug49NativeMenu(int order) {
    super(order);
    }
    public Object run(Object context) {
    Bug49Screen screen = new Bug49Screen();
    UiApplication.getUiApplication().pushScreen(screen );
    return null;
    }
    public String toString() {
    return "Bug 49";
    }
    }
    }







    Note that when not launching the application from native the sublayout of screen gets called each time the orientation is changed by the user but when i launch the application from native the sublayout is only called for the first time and is never called again even on orientation change made by user. Plz help me with this.



    Thanks,

    Sagar
    05-14-09 02:15 AM
LINK TO POST COPIED TO CLIPBOARD