1 Replies - 1076 Views - Last Post: 05 July 2011 - 10:36 AM

#1 cosmicappuccino  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 25
  • Joined: 23-December 08

BlackBerry app: Switch screens when button clicked

Posted 05 July 2011 - 10:02 AM

I'm very new to BlackBerry app development and am trying to implement a button that when clicked, will take the user to another screen. I keep getting:

JVM Error 104
Uncaught:
IllegalStateException

I'd appreciate any advice on what I'm doing wrong. Here's my relevant code:

ButtonField btn_next = new ButtonField("Next");
  btn_next.setChangeListener(new FieldChangeListener() {
    public void fieldChanged (Field field, int context) {
      UiApplication.getUiApplication().invokeLater(new Runnable() {
        public void run() { UiApplication.getUiApplication().pushScreen(new ScreenTwo()); }
      });
    }
  });


The above code is located within:

public class ScreenOne extends MainScreen


Thanks a lot!

Is This A Good Question/Topic? 0
  • +

Replies To: BlackBerry app: Switch screens when button clicked

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10447
  • View blog
  • Posts: 38,690
  • Joined: 27-December 08

Re: BlackBerry app: Switch screens when button clicked

Posted 05 July 2011 - 10:36 AM

Moved to Mobile Development. Please reserve the Java Programmers forum for topical, non-help related discussion.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1