views:

262

answers:

3

Hi guys, I have a BlackBerry app running in the background that needs to know when a "Missed call" system dialog is brought up by the system, and programmatically close it without user intervention. How can I do that?

I could actually almost know when the dialog is brought up, i.e. a little later I programmatically end the call...but how can I get a reference to the dialog, and close it?

+1  A: 

(Haven't tried this myself) Your app could periodically poll the system for the foreground app. Once it's the Phone app, you could check what's this app's topmost screen. If it's the Missed Call screen, as magically identified by the screen's class, some special field, text of a field, and the likes, pop this screen off the display stack.

Alexander
+1  A: 

Use the PhoneLogListener to fine when the incoming call is added to the phone log.

Get the active screen from: here

kozen
A: 

Key press injection for device Close button looks like this:

KeyEvent inject = new KeyEvent(KeyEvent.KEY_DOWN, Characters.ESCAPE, 0);
inject.post();

Don't forget to set permissions for device release: Options => Advanced Options => Applications => [Your Application] =>Edit Default permissions =>Interactions =>key stroke Injection

May be useful:
BlackBerry - Simulate a KeyPress event

Max Gontar