I am currently developing a blackberry app. the scenario is when a user clicks on a menu item, it will go to another page. Currently there are 3 classes, MyApp, SecondPage and MyScreen. the codes below belongs to SecondPage.
From MyApp, I am trying to pushScreen to SecondPage after the user clicks on a MenuItem but I'm unable to do so because it(SecondPage) is extending UiApplication am I right? but if I change it to extend MainScreen, it cant pushScreen(_screen). any suggestions please?
Thanks, Hend
class MyApp extends UiApplication{
//creating a member variable for the MainScreen
MainScreen _screen= new MainScreen();
//string variables to store the values of the XML document
String _node,_element;
Connection _connectionthread;
public static void main(String arg[]){
    MyApp application = new MyApp();
    //create a new instance of the application
    //and start the application on the event thread
    application.enterEventDispatcher();
}
public MyApp() {
    _screen.setTitle("Agenda");//setting title
    //_screen.add(new RichTextField("Requesting....."));
    _screen.add(new SeparatorField());
    pushScreen(_screen); // creating a screen
    //creating a connection thread to run in the background
    _connectionthread = new Connection();
    _connectionthread.start();//starting the thread operation
}
    public void updateField(String node, String element) 
{    
    synchronized (UiApplication.getEventLock()) 
    {
        String title = "My App";
        _screen.add(new RichTextField(/*node + " : " +*/ element + "\n" ));
        if (node.equals(title))
        {
            _screen.add(new SeparatorField());
        }
    }
}