0

Hy.

I have a situation with an UiApplication for Blackberry 5.0.0 OS that may be of interest to the communnity or with wich someone could help me.

My application implements the PhoneListener interface to be notified when an outbound call is detected on the device (callInitiated method). Upon that, the app simulates a disconnect key press to cancel the call. Then, a Dialog is launched and some action is required on the user side...

All works well when the number is dialed through the phone app, the dialog is launched, the phone app dissapears and the dialog remains on screen waiting for user action. But if the user dials through the contacts list, speed dial or numbers in web pages, the dialog appears but quickly dissapears when the phone app dissapears (after the call is artificially disconnected).

I'll be paciently awaiting for a response from someone that can shed some light on this... thanks.

4

1 回答 1

0

解决方案:

必须以另一种方式创建对话框。顺便说一句,我正在使用 Dialog.ask。

Screen screen = null;
synchronized(UiApplication.getEventLock()){ 

    UiEngine ui = Ui.getUiEngine();
    screen = new Dialog("<dialog text>", <options>, <values>, 0, Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION));
    ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_MODAL);

}
int appMethodAsked = ((Dialog) screen).getSelectedValue();

需要注意的是,此代码工作的一个关键细节是传递给 pushGlobalScreen 方法的 UiEngine.GLOBAL_MODAL 值。没有这个,将发生与问题相同的事情。

于 2012-11-07T13:54:12.023 回答