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

Web and WebWorks Development

Reply
Highlighted
Developer
Posts: 27
Registered: ‎02-22-2010
My Device: Password
Accepted Solution

Detect Application Foreground or in <<Standby>>

Hello,

 

I'm using webworks and trying to detect when the application is in <<Standby>> with the other apps sleeping (on the 4 window screen) and when it's being called back to the main display. I remeber seeing something about this a while ago but I cannot find anything about it now.

 

Does anybody have access to an example?

 

Thank

Alex

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Detect Application Foreground or in <<Standby>>

Which platform are you targeting - BlackBerry 10 or is the on the BBOS?

 

If its BlackBerry 10, there are system events that occur when the application state changes.  Theoretically, one could build a WebWorks extension (similar to the one proposed here https://github.com/blackberry/WebWorks-Community-APIs/issues/150) that listens for the following event:

 

NAVIGATOR_WINDOW_INACTIVE
Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Developer
Posts: 27
Registered: ‎02-22-2010
My Device: Password

Re: Detect Application Foreground or in <<Standby>>

Thanks,

 

I'm working with BB10

Developer
Posts: 27
Registered: ‎02-22-2010
My Device: Password

Re: Detect Application Foreground or in <<Standby>>

Found the solution after I followed you links.. I wasn't looking at the right place.

 

https://developer.blackberry.com/html5/apis/blackberry.app.html#.event:resume

 

onResume is trigger when the app comes back on BB10.

 

Thanks