I am trying to push a new screen when a bitmap is "clicked" on the screen. For this I have created a Class from this post: Blackberry Clickable BitmapField whose partial code I've posted below:
public class CustomMenuButtonField extends Field{
Bitmap normal,focused;
...
protected boolean navigationClick(int status, int time)
{
// push new screen
fieldChangeNotify(0);
return true;
}
...
I want to push a new screen when the user clicks the bitmap. I have consulted this thread: Communicating between classes, but I still can't figure out the commands to call the new screen command. The UserInterface I have so far is:
public class UserInterface extends UiApplication {
public static void main(String[] args){
UserInterface theApp = new UserInterface();
theApp.enterEventDispatcher();
}
public UserInterface() {
pushScreen(new UserInterfaceScreen());
}
}
final class UserInterfaceScreen extends MainScreen {
public UserInterfaceScreen() {
...
What would be the command to pop up the new screen, and more importantly where would I be able to work on it? I know it should probably use pushScreen() but that is not recognized in that class. Would I create a new final class NewScreenFromClick extends MainScreen? and if so how would I call it and put it in the eventDispatcher. I've been going through the blackberry site but they don't have much sample code on this issue and I am very new to Java so this is fairly confusing to me.