Reputation: 29122
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. How can I achieve that?
Upvotes: 1
Views: 1090
Reputation: 781
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)
.
Upvotes: 0
Reputation: 45408
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.
Upvotes: 2