Hum, I don't have much to add here either. and I never bothered to set the mode. I just update tables. I have quite a bit of code like this:
Main.sqlite.ExecNonQuery2(strSQL,pValues)
So I create the instance of sqlite ONE time in the main - as global. I been running a database quite hard for about a year - never a problem. I wonder if say a form/view is filled out - and then say the power button is hit or some such.
I in near all cases force a save of the data in Activity_Pause event. (and thus on resume the record WAS saved, and then on resume, the code re-loads that same record - hence automatic state management).
So, perhaps the data is entered, not saved, and then the phone is paused. On resume, the code would HAVE to re-load that data - but if not saved, then no data would be avaible. Since I save on activity pause, then even when a user hits power button or the hard back button - the data is saved right at that point in time.
As noted, we are in speculating territory.
And like Saif, I always have created and setup the database using dbBrowser (desktop). And only the db file was sent/saved to the phone. And I don't delete/re-create a file. (os caching is really nasty if the file is transferred from the sd or memory to say a computer - so we need to know if some file copy occurs during this process in any case. (I could NEVER copy a file correctly unless I re-booted the phone).
This database is small - about 7 tables - (but all related data), and largest table is is 2500 records.
My bets? the phone has limited memory, or some kind of SD card manager (that I had to re-boot for a file copy on my phone).
And note that power-off button, back button, or switch app buttons will triggers the pause event - the poster will have to come back and note/explain or look at what occurs when activity pause occurs.
Back button, power button, switch application button - ALL of these will trigger a pause event, and then resume if app is used again - - and then we down to what occurs on resume event - and that's where my betting money is right now.
Regards,
Albert D. Kallal
Edmonton, Alberta Canada