Android Question Works Resumable sub like CallSubdelayed?

Emme Developer

Well-Known Member
Licensed User
Longtime User
As wrote in title, works resumable sub like callsubdelayed?
If i close an activity meanwhile an httpdownload is in execution, my activity will be reopened.
Is the resumable sub that reopens the activity when flow is resumed, or the execution of httpJob?

This is the code:
B4X:
    Dim j As HttpJob
    j.Initialize("",Me)
    j.Download(url.Replace("_normal",""))
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        imgLoad.Visible  =True
        pb.Visible = False
        imgLoad.Bitmap = j.GetBitmapResize(imgLoad.Width,imgLoad.Height,True)
    End If
    j.Release

Thanks
 

Emme Developer

Well-Known Member
Licensed User
Longtime User
Resumable subs wait for events. CallSubDelayed raises events.
So they are doing different things.

HttpJob raises the event with CallSubDelayed. How you handle the event doesn't matter.
So is httpJob that reopen the activity, because it uses CallSubDelayed. I suppose so that if i use a "Wait For" to wait an event which is raised without using CallSubDelayed, then the activity will not be reopen, and the event is not handled if activity is previously closed
 
Upvote 0
Top