开发者

Blackberry screen navigation

开发者 https://www.devze.com 2023-01-27 17:39 出处:网络
I wa开发者_开发百科nt to know how to go from one screen to another by clicking a button that I have added to aMainScreen.I mean just like we do in the Android onClick event for a button - startanother

I wa开发者_开发百科nt to know how to go from one screen to another by clicking a button that I have added to a MainScreen. I mean just like we do in the Android onClick event for a button - start another startActivity.


In the event handler for the button click, just "push" the screen that you want to appear next, and it will be pushed to the top of the screen stack. For example:

UiApplication.getUiApplication().pushScreen(nextScreen);


This will be better, using FieldChangeListener

button.setChangeListener(new FieldChangeListener()
{
    public void fieldChanged(Field field, int context) 
          {
           UiApplication.getUiApplication().pushScreen(new NextScreen());
          }
});

This is the alternative way than using,

UiApplication.getUiApplication.involeLater()
{};
0

精彩评论

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

关注公众号