Reputation: 7421
My android application uses an sqlite database and during first run it deletes some rows. The next time it runs it tries to do the same , but because the rows were previously deleted it fails. I use SQLite database browser to inspect the database, after first run (when the rows are deleted) and I observe that the rows that no longer should exist are still in the database, even if ehwn running the app again those rows are no longer visible ! What is the cause for this behavior ?
Upvotes: 2
Views: 1018
Reputation: 26
I have overcome this by throwing everything into a Cursor and then checking the size of the Cursor object using its getCount() method; if it comes out as zero, then I branch off and stop attempting any DB actions other than creating rows/tables.
Upvotes: 1