Hi, I have a question with the download of images. I want to download an image before that execution of calling routine continues.
Something like:
How can I do?
Something like:
B4X:
Sub Authentication
'initial code
LoadImage 'Function
'other code that I want to execute after the download of image
End Sub
Sub LoadImage
Dim imageRequest As HttpRequest
imageRequest.InitializeGet(url & "imagename.jpg")
Client.Execute(imageRequest,1)
End Sub
Sub Client_ResponseSuccess(Response As HttpResponse, TaskId As Int)
Response.GetAsynchronously("ResponseSub",File.OpenOutput.......
End Sub
Sub ResponseSub_StreamFinish (Success As Boolean, TaskId As Int)
If Success = True Then
Photo.Initialize......... 'Photo is a Bitmap
End If
'Now I want to execute the other code of "Sub Authentication" after calling "LoadImage"
End Sub
How can I do?