开发者

BlackBerry - Detecting when my application is sent to the Background because of a Call

开发者 https://www.devze.com 2022-12-14 12:46 出处:网络
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

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


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.


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号