Android Question http Job question

Prosg

Active Member
Licensed User
Longtime User
Hello,

B4X:
'Récupère toutes les infos du user
    Dim jobUser As HttpJob
    jobUser.Initialize("jobUser", Me)
    jobUser.Download2("http://www.xxxxxxxxx.com/WebServices/loadjobUser.php", _
    Array As String("user_email", Starter.user.email,"password",myFunctions.chkPassword(Starter.user.password)
  
    BuildDrawer

Question :
Is it possible to run BuildDrawer after Job finished ?

I know i can move BuildDrawer in Job.Success but i want like my exemple before
B4X:
If Job.Success Then
    Dim res As String, action As String
        res = Job.GetString
        'Log("Back from Job:" & Job.JobName  & ", Success = " & Job.Success)
        'Log("Response from server: " & res)     
      
        Dim parser As JSONParser
        parser.Initialize(res)
              
        Select Job.JobName
            Case "jobUser"
                Dim infos As List
                infos = parser.NextArray
.........
BuildDrawer
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
Moving it into Job.Success is the correct thing to do.
It's event driven programming, therefore you have to wait for the job to finish before calling BuildDrawer. Why do you want to keep it in the first routine?
 
Upvote 0
Top