westmeadboy wrote:
> Do you mean a new connection to the database for each activity?
> 
> With my model, the database connection is lazily opened but only once.
> Essentially, the database is opened the first time an activity is
> created in that VM.
> 
> I don't want to tie the lifecycle of the database connection to
> activities, but rather to the application/VM itself.

That will be difficult.

Create a reference-counting accessor to the database; when the reference
count hits zero, close it. If the reference count starts at zero on an
access request, open it.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_
Version 1.3 Available!

-- 
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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to