Android Question Snip code for DBUtils.InsertMaps and waitfor (resumable)

Bob Spielen

Active Member
Licensed User
Hello!
Iam downloading some resources (data) and saving them in a JobDone_Sub. Each data will receive a PO_Number and then I have to send it back to the cloud. How garante that DbUtils.InsertMaps will be finished before I begin to send the data back with (job.PostString("http://....", "UPDATE.....")

B4X:
Sub JobDone(job As HttpJob) 
    ProgressDialogHide
    Public badger1 As Badger
  
    If job.Success Then
        Log("Job.GetString=" & job.GetString)
        Select job.JobName
          
            Case "BxContatos"
                ' Produtos: idpi, itens
                Dim Itens As String
                Dim parser As JSONParser
                parser.Initialize(job.getstring)
                Dim root As List = parser.NextArray
                Dim Dcolroot As Map
                Dcolroot.initialize
                If root.Size>0 Then
                    Dcolroot=root.Get(0)
                    DBUtils.InsertMaps(ADM.SQL3, "contatos", root)
                End If
 
Top