Story:
my app has the possibility for 3 languages. however i have to restart the app to the language effect on the menu's. As seen on the forum "restart" is not possible.
I do following:
choose language and exit app
what i do in code:
than i click on the icon of the app (to start) and get following (image did not upload):
"An error has occurred in sub:
Java.lang.illegalStateExeption: attempt to re-open
an already-closed object: SQLitedatabas: /path of file/database.db
continue?"
if i say YES then same error is shown
if i say no AND re-click the app ICON, than app starts with no problems.
Now my questions:
1) do i click to quick to restart my app?
2) is there a way to wait until SQL.Close is really closed?
3) and last: is there an other way or A way to restart app?
one other question came to my mind: do i have to open the database.db in every activity
or only ones in the main (did not test this yet)?
long story but thanks to anyone who wants to reply.
as an addition I just discovered it's not only the change language but also close and start app. after this more code to show
and
Regards, Léone
my app has the possibility for 3 languages. however i have to restart the app to the language effect on the menu's. As seen on the forum "restart" is not possible.
I do following:
choose language and exit app
what i do in code:
B4X:
SQL.Close
DoEvents
Activity.Finish
than i click on the icon of the app (to start) and get following (image did not upload):
"An error has occurred in sub:
Java.lang.illegalStateExeption: attempt to re-open
an already-closed object: SQLitedatabas: /path of file/database.db
continue?"
if i say YES then same error is shown
if i say no AND re-click the app ICON, than app starts with no problems.
Now my questions:
1) do i click to quick to restart my app?
2) is there a way to wait until SQL.Close is really closed?
3) and last: is there an other way or A way to restart app?
one other question came to my mind: do i have to open the database.db in every activity
or only ones in the main (did not test this yet)?
long story but thanks to anyone who wants to reply.
as an addition I just discovered it's not only the change language but also close and start app. after this more code to show
B4X:
DBUtils.CopyDBFromAssets("database.db")
B4X:
If FirstTime Then
SQL.Initialize(File.DirDefaultExternal, "database.db", True)
End If
Regards, Léone
Last edited: