Go Back   BlackBerry Forums at CrackBerry.com > BlackBerry Professionals > Developer's Forum

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-14-2009, 04:15 AM
CrackBerry Newbie
 
Join Date: May 2009
Posts: 2
Default Orientation problem in storm

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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



 
 Site Support | Accessory Order Support | App Store Support | Advertise | Newsletter | About Us

Creating smartphone communities
Android Central - Android reviews, news and forums Crackberry - Blackberry news, reviews and community TiPb - iPhone news, accessory reviews & forums
Pre Central - Palm Pre Review, News and Community Treo Central - Treo & Centro News and Forums WMExperts - Windows Mobile Reviews & News

The names RIM and BlackBerry are registered Trademarks of Research in Motion Limited.
CrackBerry.com is in No Way Affiliated with Research in Motion Limited.
Copyright ©2007-2009 Smartphone Experts. Terms and Conditions. Privacy Policy. All rights reserved.