On Tuesday, October 11, 2011 6:55:08 AM UTC-4, Mark Murphy (a Commons Guy) 
wrote:
>
> On Tue, Oct 11, 2011 at 6:13 AM, Zsolt Vasvari <zvas...@gmail.com> wrote:
>
> > I do wish there were a onDestory() on the Application object
> > so I could close the databases before Android terminates my app, but
> > alas, there isn't.
>
> Well, there is onTerminate(), but it's never used.
>
While its not as bulletproof as an onDestroy or onTerminate, for various 
reasons I keep a reference count on the number of activities my app opens.  
When the reference count goes to zero I cleanup stuff on the app scope, 
assuming that the Application context is going away soon.

Maybe it'll help?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to