Sebastián Treu wrote:
> On Wed, May 12, 2010 at 7:25 PM, brucko <[email protected]> wrote:
>> This all sounds like a local Service to me. Open the db in onBind if
>> its not open. Let the service take care of how many Activities/
>> Services are bound and close the db in onUnbind.
> 
> If you don't have a reference to the db and you are trying to open it,
> how do you know if it's opened or not?

Open the database connection in the service's onCreate() and close it in
the service's onDestroy().

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | 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