I implemented the singleton approach in the end, and it works pretty
well.

I pass the application context to get the instance and that's enough
to open the database and do various other pieces of initialisation I
need across the app.

In Activity1.onDestroy() I close the database. However, is this a good
approach? Is it not possible that Activity1 is killed but Activity2
stays alive? If so, then Activity2's db calls will suddenly fail.

On Mar 8, 2:16 pm, Mark Murphy <[email protected]> wrote:
> westmeadboy wrote:
> > Is it true that Activity1 would be automatically recreated? In other
> > words, is the activity stack preserved across VM kills?
>
> AFAIK, yes.
>
> > Also, is the getIntent() data preserved?
>
> Yes.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, One Low Price!

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

Reply via email to