Hi all.
i have this class:
And this is activity
Now this is wrong
the valore = is "" because dont wait Jobdone - asyn - etc. ... What do i do to return the value ??
Any idea ??
Thank you
Marco
i have this class:
B4X:
'Class module
Sub Class_Globals
Dim valore As String
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize ( email As String ) as String
Dim dominio() As String
dominio = Regex.Split("@", email)
Dim job1 As HttpJob
job1.Initialize("MyJob", Me)
job1.Download("https://xxxx.com/" & dominio(1))
return valore
End Sub
Sub JobDone(job As HttpJob)
ProgressDialogHide
If job.Success Then
Dim res As String
res = job.GetString
'Log("Back from Job:" & Job.JobName )
Log("Response from server: " & res)
Dim parser As JSONParser
parser.Initialize(res)
Dim m As Map
m = parser.NextObject
Log(m.Get("status"))
valore = m.Get("status") '<------- THIS IS RETURN VALUE "OK" and work
Else
ToastMessageShow("Error: " & job.ErrorMessage, True)
End If
job.Release
End Sub
And this is activity
B4X:
Dim aa As checkemail
Dim vediamo As String
if aa.Initialize("info@devil-app.com") = "OK" then....
Now this is wrong
the valore = is "" because dont wait Jobdone - asyn - etc. ... What do i do to return the value ??
Any idea ??
Thank you
Marco