SQLite in android

My android application is using sqlite database and during the first run it deletes some rows. The next time it starts up, it tries to do the same, but because the lines were previously deleted, it fails. I am using the SQLite database browser to check the database after the first start (when the rows are deleted) and I notice that the rows that should no longer exist are still in the database, even if ehwn starts the application, these rows are no longer visible ! What is the reason for this behavior?

+2


a source to share


1 answer


I overcame this by throwing everything into the Cursor and then checking the size of the Cursor object using the getCount () method; if it exits as zero, then I disconnect and stop trying to do anything with the DB except creating rows / tables.



+1


a source







All Articles