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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Android™ Runtime Development

Reply
Developer
Dekerta
Posts: 80
Registered: ‎11-25-2010
My Carrier: Rogers

run code when user exits application?

Is there a method I can override which runs when the user exits the Android runtime? (ie: by swiping the application off the screen)

 

I need to save the user's work before the application is closed.

 

I have tried finalize(), onTerminate(), and onDetatchedFromWindow(), but nothing seems to work.

 

Thank you!

__________________________________________________
If my post helped you, make sure to give me kudos by clicking the star below my name! :smileyhappy:
Please use plain text.
Contributor
mattdonders
Posts: 46
Registered: ‎02-15-2012
My Carrier: Verizon Wireless

Re: run code when user exits application?

[ Edited ]

Have you tried onDestroy( ) or onStop( ) ?

Please use plain text.
New Developer
flowi88
Posts: 10
Registered: ‎11-28-2012
My Carrier: Wifi

Re: run code when user exits application?

Swiping the application off the screen?
Have a look at the official Android developer reference.

http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle

In your case you should try onStop or onDestroy.
Please use plain text.