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

Posts: 22
Registered: ‎06-11-2009
My Device: Bold 9700
My Carrier: Bell Canada
Accepted Solution

Detecting application switch



Does anyone know how to detect if my application has been switched?
I'm working on one that contains sensitive data, and I'd like to have the application automatically logout when the application is switched to something else.




Joel Barnard

Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-, Z10 (STL100-3)-, Z30 (STA100-5)-, Passport (SQW100-1)-, PlayBook (16GB)-
My Carrier: Verizon

Re: Detecting application switch

Simply override Application.deactivate(), it gets called when the application is sent to background (like when application switch gets invoked) and you can do all your processing there.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.