12-01-2009 08:17 PM
Hi, my program listens to a server and launches an global notification using pushGlobalScreen when the server pushes important info to the client .
NotifyingGUI screen = new NotifyingGUI(incoming.toString(),s);
UiEngine ui = Ui.getUiEngine(); ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_QUEUE);
The notification object extends Dialog and will also start a vibration alert in the class.
While testing on the simulator, I noticed that this will get pushed even if the user was in a phone call, and presumably in other application as well. Since neither the screen nor the vibration is desired during a phone call, how do we resolve this?
I'm quite new to blackberry programming so I'm unfamiliar as to how to deal with these kind of global interactions. Any help is greatly appreciated.
Cheers
12-01-2009 08:25 PM
Use:
PhoneCall call = Phone.getActiveCall()
..to determine if there is an active call. If there is, try the notification later.
12-01-2009 10:19 PM
Thanks for the reply. I will look into the phone api to give it a try.
Just as a side point, are there any other solutions to this? I'm wondering because I could forsee the user might have other operations that might not want to be interrupted by my notificaiotn. Is there a way to set some sort of global priority? The priority in the pushglobalscreen field only refers to the priority between other global screens.
12-02-2009 12:03 AM
Maybe something like using ApplicationMessage(s) will be a better thing to do?
12-02-2009 04:39 PM
I'm looking for JDE.4.2.1 though due to some client using older version blackberries.