guardianproject/android-database-sqlcipher — Issue #20: Ambiguous behaviour of the database when the database is deleted and recreated
Author: pankaj20aug
Created: 2011-10-31 15:46:49+00:00
State: open

I use a SqliteOpenHelper to create a database (say "MyDB"). During a particular condition I have to clear the database. So I use context.deleteDatabase("MyDB") to remove the db and recreate it once again. But after this the database starts behaving erratically. For instance while fetching entries (using the same query) from the DB I get correct results during the first 2 times but 3rd time onwards I donot get any data.

On the other hand If I somehow manage to kill my app (using Task killer) and then repeat the above process everything works fine.

I have cross-checked my code a number of times and haven't found couldnot find any bug.