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

Native Development

Reply
Developer
Posts: 194
Registered: ‎11-24-2012
My Device: Dev Alpha B, Bold 9700
My Carrier: NA
Accepted Solution

Notify when app goes to inactive or active state?

I can't seem to find the right search words.  I want to be notified when the app becomes inactive / minimized due to:

user minimizing the app

when the device is put or goes to sleep

 

I also want to know when:

app becomes active / goes to foreground

 

How do I check for these events?

Developer
Posts: 1,523
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Notify when app goes to inactive or active state?

Hi! Check Application::instance() signals in Application.hpp:

void thumbnail();
void fullscreen();
void invisible();
void asleep();
void awake();

Andrey Fidrya, @zmeyc on twitter
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Notify when app goes to inactive or active state?

Critical background (no pun intended) on this stuff is at https://developer.blackberry.com/cascades/documentation/dev/fundamentals/index.html

 

Also see https://developer.blackberry.com/cascades/reference/bb__application.html for the API docs on the items mentioned in the previous post.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 194
Registered: ‎11-24-2012
My Device: Dev Alpha B, Bold 9700
My Carrier: NA

Re: Notify when app goes to inactive or active state?

Thanks guys.  I remember seeing the docs before a few weeks back, but couldn't find it.

 

Links to the docs were very helpful!