views:

171

answers:

2

Hi All,

I need to detect when my BlackBerry application is sent to the background and also when it's brought to the foreground again. I need to pause the application when a phone call comes in and resume appropriately.

I assume this must be trivial to achieve but I can't find any reference to how this is done. Please put me out of my misery!

Gav

+2  A: 

Take a look at the Application.activate() and Application.deactivate() methods - just override those methods in your app to define some custom behavior when these events occur.

Marc Novakowski
A: 

If you need to know that the specific reason your app was sent to the background is because of an incoming phone call you can implement the PhoneListener interface and register via Phone.addPhoneListener(listener).

Orr Matarasso