2
edits
Changes
3 code
''pushScreen(new NextScreen());'' where the NextScreen is a class that will define the next screen of the app.
Thus the constructor of our app will look like:
<source lang="java">
public MyApp() {
// Push a screen onto the UI stack for rendering.
_screen = new MyScreen();
_nextScreenButton = new ButtonField("Go to Next Screen",
ButtonField.FIELD_HCENTER | ButtonField.CONSUME_CLICK);
_nextScreenButton.setChangeListener(new FieldChangeListener() {
public void fieldChanged(Field field, int context) {
pushScreen(new NextScreen());
}
});
_screen.add(_nextScreenButton);
pushScreen(_screen);
}
</source>