This is about the second example with more functions.
1- First run just after installation is ok
2- next run (run 2) brings exception
LogCat connected to: emulator-5554
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
ExecuteHtml: SELECT ID, FirstName As [First name], LastName As [Last name], City FROM persons
** Activity (main) Pause, UserClosed = false **
** Activity (edit) Create, isFirst = true **
** Activity (edit) Resume **
** Activity (edit) Pause, UserClosed = true **
** Activity (main) Resume **
ExecuteHtml: SELECT ID, FirstName As [First name], LastName As [Last name], City FROM persons
** Activity (main) Pause, UserClosed = false **
** Activity (edit) Create, isFirst = false **
** Activity (edit) Resume **
** Activity (edit) Pause, UserClosed = true **
** Activity (main) Resume **
ExecuteHtml: SELECT ID, FirstName As [First name], LastName As [Last name], City FROM persons
** Activity (main) Pause, UserClosed = true **
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
java.lang.IllegalStateException: database not open
at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1333)
at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1315)
at anywheresoftware.b4a.sql.SQL.ExecQuery2(SQL.java:167)
at anywheresoftware.b4a.sql.SQL.ExecQuery(SQL.java:155)
at b4a.sqlitelight2.main._executehtml(main.java:384)
at b4a.sqlitelight2.main._showtable(main.java:573)
at b4a.sqlitelight2.main._activity_resume(main.java:327)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:174)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:158)
at b4a.sqlitelight2.main.afterFirstLayout(main.java:104)
at b4a.sqlitelight2.main.access$100(main.java:16)
at b4a.sqlitelight2.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
java.lang.IllegalStateException: database not open
Note:
after the exception I have two options: Continue, yes or no
If I chose yes, database is blank, and next run will be the same error
If I chose No, it will exit the App, but next run the data is there but any editing or added records are lost
Note: no modification.
1- First run just after installation is ok
2- next run (run 2) brings exception
LogCat connected to: emulator-5554
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
ExecuteHtml: SELECT ID, FirstName As [First name], LastName As [Last name], City FROM persons
** Activity (main) Pause, UserClosed = false **
** Activity (edit) Create, isFirst = true **
** Activity (edit) Resume **
** Activity (edit) Pause, UserClosed = true **
** Activity (main) Resume **
ExecuteHtml: SELECT ID, FirstName As [First name], LastName As [Last name], City FROM persons
** Activity (main) Pause, UserClosed = false **
** Activity (edit) Create, isFirst = false **
** Activity (edit) Resume **
** Activity (edit) Pause, UserClosed = true **
** Activity (main) Resume **
ExecuteHtml: SELECT ID, FirstName As [First name], LastName As [Last name], City FROM persons
** Activity (main) Pause, UserClosed = true **
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
java.lang.IllegalStateException: database not open
at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1333)
at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1315)
at anywheresoftware.b4a.sql.SQL.ExecQuery2(SQL.java:167)
at anywheresoftware.b4a.sql.SQL.ExecQuery(SQL.java:155)
at b4a.sqlitelight2.main._executehtml(main.java:384)
at b4a.sqlitelight2.main._showtable(main.java:573)
at b4a.sqlitelight2.main._activity_resume(main.java:327)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:174)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:158)
at b4a.sqlitelight2.main.afterFirstLayout(main.java:104)
at b4a.sqlitelight2.main.access$100(main.java:16)
at b4a.sqlitelight2.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
java.lang.IllegalStateException: database not open
Note:
after the exception I have two options: Continue, yes or no
If I chose yes, database is blank, and next run will be the same error
If I chose No, it will exit the App, but next run the data is there but any editing or added records are lost
Note: no modification.
Last edited: