Piyush
Piyush

Reputation: 2609

Blackberry screen navigation

I want 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.

Upvotes: 0

Views: 1018

Answers (2)

user2881379
user2881379

Reputation:

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()
{};

Upvotes: 0

Marc Novakowski
Marc Novakowski

Reputation: 45398

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);

Upvotes: 2

Related Questions