Hi,
I can't seem to figure this out. When I call the following code, it hangs on the Wait For:
But, if I run it like I have the other API calls in my app, with the result going to the
sub, then it works perfectly. I could run it that way, but I like the idea of waiting for it in the same sub.
Can anyone see what I'm doing wrong?
I can't seem to figure this out. When I call the following code, it hangs on the Wait For:
B4X:
Dim strThisURL As String = "URL of my API"
Dim j As HttpJob
j.Initialize("" , Me)
j.Download(strThisURL)
Wait For (j) JobDone(j As HttpJob) ' Hangs Here
Dim MyDataList As List
Dim parser As JSONParser
Dim response As String = j.GetString
parser.Initialize(response)
But, if I run it like I have the other API calls in my app, with the result going to the
B4X:
Sub JobDone (Job As HttpJob)
:
:
End Sub
sub, then it works perfectly. I could run it that way, but I like the idea of waiting for it in the same sub.
Can anyone see what I'm doing wrong?