Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
zazahht
Posts: 4
Registered: ‎07-26-2010
My Device: 9300,9800

How to catch event Alarm in BB phone

When an app's running, if an alarm event occured, the app still runs behind.

In some apps, it's no problem but this is sometimes needed on the others.

I have tried to debug but cannot find how to resolve.

Can somebody help me?

Thanks,

BlackBerry Development Advisor
MSohm
Posts: 14,757
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: How to catch event Alarm in BB phone

[ Edited ]

You can detect if another application/screen has appeared on top of your application by overriding the Screen.onObscured method.  The Screen.onExposed method is fired when a screen returns to view (is on the top of the display stack).

 

This won't catch the alarm specifically, but is a generic option that works whenever another application appears on top of yours.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Contributor
zazahht
Posts: 4
Registered: ‎07-26-2010
My Device: 9300,9800

Re: How to catch event Alarm in BB phone

I understand your solution but could you explain more details.

Thank a lot :smileyhappy:

 

BlackBerry Development Advisor
MSohm
Posts: 14,757
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: How to catch event Alarm in BB phone

When a screen appears on top of your screen (by your application or another application) the onObscured method of your screen will be called.  Once this screen is dismissed and your screen is once again on top, the onExposed method of your screen will be called.

 

Therefore you can override these two methods on your screen to detect when another application/screen appears on top of yours and pause and resume your application as required.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker