In a B4XPages project I am downloading map tiles in a Sub in a non-B4XPage class (clsMapTileManager). This can be a long process, so I am trying to keep it going with PhoneWakeState and PartialLock. This works for a while, but eventually the process is interrupted by the OS and that triggers in Main:
This then tries to restart the app at the main entry point and this fails as in the Sub downloading the tiles there is a different SQLite DB connection to store the tiles in a SQLite DB, other than the main DB.
How do I instead resume the Sub that downloads the tiles, without any user intervention? This is not simple as the Sub that downloads the tiles is started from a Sub in a B4XPage with user intervention via dialogs. I tried to run the tile downloading Sub in a service, but this is problematic due to Activity objects no being available in the Service.
RBS
B4X:
Sub Activity_Resume
B4XPages.Delegate.Activity_Resume
End Sub
This then tries to restart the app at the main entry point and this fails as in the Sub downloading the tiles there is a different SQLite DB connection to store the tiles in a SQLite DB, other than the main DB.
How do I instead resume the Sub that downloads the tiles, without any user intervention? This is not simple as the Sub that downloads the tiles is started from a Sub in a B4XPage with user intervention via dialogs. I tried to run the tile downloading Sub in a service, but this is problematic due to Activity objects no being available in the Service.
RBS