Hi,
I have Sub JobDone(Job As HttpJob) procedure that is parsing JSON from my server, all is fine but i need to show progressbar1.progress and update it on each increse I variable in Map1 JSON Parser...but it does not update on apk start, it updates it when JobDone is finished...how to do it to update progressbar in JobDone procesure? Here is example that is not working as expected:
Erel can you give me example code how to update progressbar position in job done?
I have Sub JobDone(Job As HttpJob) procedure that is parsing JSON from my server, all is fine but i need to show progressbar1.progress and update it on each increse I variable in Map1 JSON Parser...but it does not update on apk start, it updates it when JobDone is finished...how to do it to update progressbar in JobDone procesure? Here is example that is not working as expected:
B4X:
Sub JobDone(Job As HttpJob)
'DECLARE - Variables
Dim JSON As JSONParser
Dim Map1 As Map
Dim I As Int
If Job.Success = True Then
Select Job.JobName
Case "Job0"
'DISPLAY - Status Text
Label1.Text = "Loading JSON..."
'INITIALIZE - JSON
JSON.Initialize(Job.GetString)
'INITIALIZE - Map1
Map1.Initialize
Map1 = JSON.NextObject
'LOOP - Throught List
For I=0 To Map1.Size-2
If (I = Map1.Size-1) Then
'XYZ - Informations
JSON.Initialize(Job.GetString)
Map1 = JSON.NextObject
Map1 = Map1.Get("authorization")
Authorisation(0) = Map1.Get("AAA")
Authorisation(1) = Map1.Get("BBB")
Authorisation(2) = Map1.Get("CCC")
Else
'OHOH - Informations
JSON.Initialize(Job.GetString)
Map1 = JSON.NextObject
Map1 = Map1.Get(CStr(I))
Map1 = Map1.Get("ooooo")
'ADD - Channels To Array
Channels(I,0) = I
Channels(I,1) = Map1.Get("www")
Channels(I,2) = Map1.Get("ccc")
ProgressBar1.Progress = I
End If
Next
'DISPLAY - Status Text
Label1.Text = "Loading List...OK"
ChMax = Map1.Size-2
End Select
End If
End Sub
Erel can you give me example code how to update progressbar position in job done?
Last edited: