sylvestercaro...@gmail.com wrote:
> I have a similar question. Basically I have an app with several
> activities, each needs to read different data from a common local
> SQLite db. This data doesn't have to be accessed outside of the
> application itself - hence I decided against using a content provider.
> I was thinking of using the application instance to hold the database
> instance, as I thought that each activity would be able to access this
> to retrieve it's data (I didn't want to open and close the db in each
> activity for performance reasons) - but I'm not sure if the activity
> can reference this application instance. 

It can. However, AFAIK, database connections to SQLite are cheap, so you
may just want to have each activity get its own connection.

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

Warescription: Three Android Books, Plus Updates, $35/Year

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