Dear all,
I created a B4J module (*.bas file) to make HTTP GET to a web and it worked perfectly.
Then I move this codes to a new project (Non UI), compiled it As Library (Alt + 5), and compilation success, no error. The new library showed up at library list.
However when i am calling this library from another project, Sub Jobdone is never called.
I confirmed using Wireshark, and this program is really GET-ing the web normally, so Jobdone SHOULD be called, but its not.
examining LOG outputs, "refreshing cities" and "refreshing schedules" are displayed, but "Jobdone Sub" is unavailable.
Please help what might wrong.
I created a B4J module (*.bas file) to make HTTP GET to a web and it worked perfectly.
Then I move this codes to a new project (Non UI), compiled it As Library (Alt + 5), and compilation success, no error. The new library showed up at library list.
However when i am calling this library from another project, Sub Jobdone is never called.
I confirmed using Wireshark, and this program is really GET-ing the web normally, so Jobdone SHOULD be called, but its not.
examining LOG outputs, "refreshing cities" and "refreshing schedules" are displayed, but "Jobdone Sub" is unavailable.
Please help what might wrong.
B4X:
Sub Class_Globals
Private cityget_job As HttpJob
Private shalat_job As HttpJob
Private evtname As String=""
Private parent As Object
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize(ParentObject As Object,Eventname As String)
Cities.Initialize
Sholat.Initialize
evtname=Eventname
parent = ParentObject
Log("Parent Object : "&parent)
End Sub
Public Sub refresh_cities
Cities.Initialize
cityget_job.Initialize("cityget",Me)
cityget_job.Download("http://jadwalsholat.pkpu.or.id")
Log("Refreshing cities")
End Sub
Public Sub refresh_schedules(citycode As Int)
Sholat.Initialize
shalat_job.Initialize("getshalat",Me)
shalat_job.Download("http://jadwalsholat.pkpu.or.id/monthly.php?id="&citycode)
Log("Refreshing schedules")
End Sub
Private Sub JobDone(job As HttpJob)
Log("JobDone Sub")
Dim citycode As Int = 1
If job.Success Then
Log("Job success")
Select job.JobName
Case "cityget"
........
If evtname<>"" Then
Log("Calling "&evtname&"_cityreloaded")
CallSub2(parent,evtname&"_cityreloaded",Cities)
End If
Case "getshalat"
...........
If evtname<>"" Then
Log("Calling "&evtname&"_schedulereloaded")
CallSub2(parent,evtname&"_schedulereloaded",Sholat)
End If
End Select
End If
job.Release
End Sub