I am extending the ContentProvider class and writing content provider
for my app. Some what similar to the tutorial given here http://goo.gl/91WV

What I want to know is, we create a ReadableDatabase or
WriteableDatabase instance in the overridden query method which
returns a cursor.

Now from the android documentation it states that the Database create
is cached when called getReadableDatabase or getWriteableDatabase  on
a SQLiteDatabase instance but it should be closed also.

Now in the query method of ContentProvider extended class, I get the
cursor and that is returned. If I close the DB instance my cursor is
also closed, so if I had fetched some data it vanishes. I can't close
the cursor object also (don't know whether such thing is possible).

So how is the SQLiteDatabase instance is closed finally in such a
design? Can it become problem if I have frequent db queries... like 10
calls per min...?

Please guide me if I have misunderstood the concept somehow?

Regards,
Arpit

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