Android Question Problem with B4XPages.Delegate.Activity_Resume

RB Smissaert

Well-Known Member
Licensed User
Longtime User
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:

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
 

RB Smissaert

Well-Known Member
Licensed User
Longtime User
I'm not sure that I understand.
Does the process get killed?

Can you post the logs?
I am puzzled myself as well. It doesn't look the process gets killed. For some reason the download loop (looping through X and Y tile numbers and zoom numbers) exits and then Activity runs in Main and a SQL runs that fails. I have no idea why the loop exits (no error, no log message) and no idea why it runs that SQL via the delegate. I can avoid this problem by keeping the phone moving or touching the bottom Android bar between the 3 bottom buttons. Will be away from the PC for a week now, so will solve this when I am back.

RBS
 
Upvote 0

RB Smissaert

Well-Known Member
Licensed User
Longtime User
I am puzzled myself as well. It doesn't look the process gets killed. For some reason the download loop (looping through X and Y tile numbers and zoom numbers) exits and then Activity runs in Main and a SQL runs that fails. I have no idea why the loop exits (no error, no log message) and no idea why it runs that SQL via the delegate. I can avoid this problem by keeping the phone moving or touching the bottom Android bar between the 3 bottom buttons. Will be away from the PC for a week now, so will solve this when I am back.

RBS
Forgot to say that there are no logs other than the error message regarding the failed SQL.

RBS
 
Upvote 0
Top