I am trying to copy a database that I made with SQLite manager, in which I did:
CREATE TABLE \"android_metadata\" (\"locale\" TEXT DEFAULT \'en_US\')
Another Scenario when this can happen:
You are deleting rows from the cursor while the cursor is still in use.
E.g pseudo-coden where it could happen:
while(cursor.moveToNext()){
readCursor(cursor);
deleteRowFromCursor(cursor);
}
Solution:
Keep list of rows you want to delete; build a batch delete sql statement; execute the statment out side of the while loop ( when you are done with using the cursor anymore or after you close it).
while(cursor.moveToNext()){
readCursor(cursor);
queueRowForDelete(cursor);
}
deleteQueuedRows(queuedRowsList);