开发者

blackberry - using sessions?

I am very new to this Blackberry application. How can we use sessions in this application? When moving开发者_开发百科 from login page to another one; how can I use sessions to get the user name in the next page also?


If you're talking about creating using Java to create an application for the Blackberry then you can't use Session.

One way that you can use it if it is only to pass 1 value from a screen to the next is to add a parameter to the constructor of the screen that you are navigation too:

public class aScreen extends MainScreen{
  public aScreen(String userName){
  }
}

then when navigating to that screen use:

UiApplication.getUiApplication().pushScreen(new aScreen("Rateesh"));

If it's to share a value across multiple screens then you can use a global variable declared in the class that is the main entry point for the application, which extends UiApplication or Application.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜