App on the phone and return to App

I am building an application (UiApplication) that present the options in some screens to dial a number. I invoke the 'Phone' application to call. Before entering the screen where calls may be able to start, a lot more screen are pushed in the UiApplication stack. All the work of fin. Once the call is finished, I want to make my application in the foreground. Can I record a PhoneListener and do the following in the callDisconnected method:

public void callDisconnected(int id)
    {
        System.out.println("Call disconnected"+id);
        //UiApplication.getUiApplication().popScreen();
        UiApplication.getUiApplication().invokeAndWait(new Runnable()
        {
            public void run()
            {
                UiApplication.getUiApplication().requestForeground();
                UiApplication.getUiApplication.pushScreen(SomeScreen.getInstance());
            }
        });

    }

The "SomeScreen" appears as quickly, but when I close the screen (DEFAULT_CLOSE), the phone call screen. I need to close these screens (call screen and call log screen) to return to the original screen battery UIApplication.

My requirement is, I should be able to make a kind of 'Swtich Application' of the function programmatically such as the associated phone screens do not reappear once my application comes to the foreground.

Did I miss something forward?

code in the earpiece of the phone is executed in the context of the phone application.

Basically, you ask the first plan for the application of the phone, not your own.

put a reference to your application in the listener, and call the method on it.

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for