Android Question SQLite Initialization Error After Resume

dlfallen

Active Member
Licensed User
Longtime User
I am developing an app based on the SQLite Viewer. Whenever a table is open and the application has been inactive for some time, I get an error message when I resume. I get exactly the same message from the original SQLite Viewer (no changes). The error message is:

Error occurred

An error has occurred in sub:dbutils_executememorytable(java
line: 381)
java.lang.RuntimeException: Object should first be initialized.

I get this error when the program is compiled in Release mode. I don't seem to get it when compiled in debug mode, but this mode has not been tested as extensively. It is not hard to get around this error by clicking "no" when asked to continue, but it is an annoyance. Any idea on how to fix this?

(Erel: I apologize for the mistake of posting this question originally in the Tutorials section).
 

dlfallen

Active Member
Licensed User
Longtime User
The error occurres when I:
1. Load my database (three tables, largest is 600 or so records with 5 or 6 fields). Note: I get this error with all my databases, not just this one.
2. Select a table to view.
3. Leave Sqlite Viewer to check my mail, browse, play games, whatever.
4. Wait a couple of hours.
5. Return to Sqlite.

I can usually produce the error without the wait in my own app if I do a few resource-hungry things before returning (not every time though). I tried this once with the original Sqlite Viewer but didn't get the error without the wait. I can try a few more times if that will help.
 
Upvote 0

dlfallen

Active Member
Licensed User
Longtime User
Just back from holiday, so I just now was able to try Erel's suggestion. It does not solve my problem. I would like the program to resume where it left off (i.e., viewing a particular table from a given database). The suggested code restarts the program which I could do without the suggested code (by pressing "yes" when asked to continue).

Because the activity is restarted, saving the DirName, FileName, and TableName in global variables won't work. I could write that information (map or text file) and read it in when the Main activity starts. Then I would always get the last database/table that I was working with. Do you think that would work, or do you have a better idea?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…