Ok, thanks.

Now, I use onTerminate to close the SqLite DB to avoid the error
saying that the database was opened but never closed. Is this error
something I need to be anal about or can I just ignore it. I know it
doesn't relate to my previous problem, but you mentioned that
onTerminate may NOT be called.

Thanks.

On Sep 30, 3:52 pm, Dianne Hackborn <hack...@android.com> wrote:
> Yes your process can be killed at any time when it is in the background (and
> onTerminate is NOT called).
>
>
>
> On Wed, Sep 30, 2009 at 3:47 PM, gnugu <rho...@gmail.com> wrote:
>
> > Hi,
> > When I start my application I prompt the user for the password and use
> > it to instantiate my data adapter object that I will need throughout
> > the application. So I store it in Application object.
>
> > My activity A prompts user for pwd, instantiates data adapter, sticks
> > it to Application object and later starts activity B which in turn
> > starts the built int gallery activity. When fooling around with
> > gallery and capturing pictures for some time coming back to activity B
> > I discover that Application.myDataAdapter is null.
>
> > I found out that during me playing with camera the
> > Application.onTerminate() method was called.
>
> > So it seems like Android killed my process and when B was supposed to
> > become visible it started a process again jumping directly to activity
> > B bypassing A?
>
> > Is that how it works? Should I then never assume that
> > Application.myField will survive? and init it not only when A is
> > started but whenever I discover it is null?
>
> > Thanks.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~---------~--~----~------------~-------~--~----~
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