Hey everybody:

I'm in the middle of writing myself an app and have run into a problem
concerning the use of the same SQLite database within multiple
activities.

I have one activity that is used to input and store data and multiple
activities that need to then read that data.  Within the first
activity, it has no problem inputting the data into the database, but
when I go to have the other activity read the data, it tells me the
database is empty.  Obviously I'm doing something wrong in my handling
of this shared database.

Right now, I have a DataHelper class that handles everything.  In each
activity, I create a DataHelper object which then calls the
openOrCreateDatabase() method.  I then close the database upon exiting
the activity.  Obviously this isn't the right way to do it.

So, my questions is, what is the correct way to set up an SQLite
database in an Android application and then access it in multiple
activities?

Any help you could give would be a huge help.  Thanks!

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