If you're closing the SQLiteOpenHelper, it means you're closing the database.

A closed database is just that, closed, and will need to be reopened - e.g. in onRestart. You will also need to run a new query, to get a fresh -- open -- cursor that you can work with.

A better way is to keep the database open at all times, and use a Java singleton so that there is only one database object instance in the entire application. This has been extensively discussed, search the list archives.

-- Kostya

04.08.2011 0:27, usafrmajor пишет:
It is the class that I created that interacts with a database table. It does the inserts, updates, deleted and selects from the db table.

It uses these classes

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
--
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

--
Kostya Vasilyev

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