I took my code from the NotePad tutorial:
private static class DatabaseHelper extends SQLiteOpenHelper {
DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
Log.e(TAG, "CREATING DAG");
createDB(db);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int
newVersion) {
Log.e(TAG, "Upgrading database from version " + oldVersion +
" to "
+ newVersion + ", which will destroy all old
data");
db.execSQL("DROP TABLE IF EXISTS scan");
db.execSQL("DROP TABLE IF EXISTS notes");
db.execSQL("DROP TABLE IF EXISTS attendee");
db.execSQL("DROP TABLE IF EXISTS attendeeqanswerlink");
db.execSQL("DROP TABLE IF EXISTS lead");
db.execSQL("DROP TABLE IF EXISTS leadnotes");
db.execSQL("DROP TABLE IF EXISTS qanswer");
db.execSQL("DROP TABLE IF EXISTS qquestion");
db.execSQL("DROP TABLE IF EXISTS rolodex");
db.execSQL("DROP TABLE IF EXISTS showinfo");
onCreate(db);
}
}
I can tell from the log that onCreate() is being called every time I start up
my app. onUpgrade() is not
being called. I can add data to the database using rawQuery(). While the app
is running I can pull
the database file to my dev box and select records from the copy. If I restart
the app, then pull
the database, it's empty.
What could be wrong?
Thanks!
Tobiah
--
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