This code is used to restore a database that the user has copied from their PC, having previously saved it from the program.
FavSQL and DeckSQL are declared in Process_Globals in the Main activity.
This code is in another activity.
The code works fine on almost all devices, with Size1, Size2 and Size3 reporting the same correct value.
However, on a Samsung Galaxy S2 running Android version 2.3.5, this code does not behave as expected.
Size1 reports the expected, correct value.
Size2 and Size3 both report a value of zero.
SQL.Initialize seems to be creating a new file rather than using the existing one.
FavSQL and DeckSQL are declared in Process_Globals in the Main activity.
This code is in another activity.
The code works fine on almost all devices, with Size1, Size2 and Size3 reporting the same correct value.
However, on a Samsung Galaxy S2 running Android version 2.3.5, this code does not behave as expected.
Size1 reports the expected, correct value.
Size2 and Size3 both report a value of zero.
SQL.Initialize seems to be creating a new file rather than using the existing one.
B4X:
Main.FavSQL.Close
Main.DeckSQL.Close
File.Copy(File.DirDefaultExternal & "/backups",sFile& ".vgbk",File.DirInternal,"vguser.db")
Log("Size1="&File.Size(File.DirInternal,"vguser.db"))
Main.FavSQL.Initialize(File.DirInternal, "vguser.db", True)
Log("Size2="&File.Size(File.DirInternal,"vguser.db"))
Main.DeckSQL.Initialize(File.DirInternal, "vguser.db", True)
Log("Size3="&File.Size(File.DirInternal,"vguser.db"))