tags:

views:

80

answers:

1
+2  Q: 

SQLite in android

Hi,

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 ?

A: 

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.

androidjutsu