Hi there
100% stuck on this one, after a few hours i dicided to ask for help.
the job was working untill i decided that i needed a secondary job.
this makes 2 simple sql querys and gets a total of today and yesterday income.
so i think i need 2 jobs so i did this:
Global
Dim job1,job2 As HttpJob
and then:
im a bit lazy so the sub ExecuteRemoteQuery gets the query and then i set the query manually below so that i have both jobs initialized there.
i had the first job working now i added the second job and my widjet fails.
the errors:
help ?
100% stuck on this one, after a few hours i dicided to ask for help.
the job was working untill i decided that i needed a secondary job.
this makes 2 simple sql querys and gets a total of today and yesterday income.
so i think i need 2 jobs so i did this:
Global
Dim job1,job2 As HttpJob
and then:
B4X:
Sub ExecuteRemoteQuery(Query As String, JobName As String)
job1.Initialize(JobName, Me)
job1.PostString("http://xxxxx.net/xxxxx.php", Query)
DateTime.TimeFormat = "yyyy-MM-dd"
s = DateTime.Time(DateTime.Now)
Yesterday = DateTime.add(DateTime.Now, 0, 0, -1)
s = DateTime.Date(Yesterday)
job2.Initialize(JobName, Me)
job2.PostString("http://xxxxx.net/xxxxx.php", "SELECT SUM(t.Total) XXXXXXX as t;")
Log("end of executeremotequery")
End Sub
B4X:
Sub JobDone(Job As HttpJob)
ProgressDialogHide
Dim res As String
Dim res2 As String
Dim parser As JSONParser
If Job.Success = True Then
Select Job.JobName
Log(Job.JobName)
Case "job1"
Log(Job.JobName)
res = Job.GetString
Log("Response from server: " & res)
parser.Initialize(res)
rv.SetText("Label2", res & "€")
Case "job2"
Log(Job.JobName)
res2 = Job.GetString
Log("Response from server: " & res2)
parser.Initialize(res2)
rv.SetText("Label3", res2 & "€")
End Select
'ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
job.Release
im a bit lazy so the sub ExecuteRemoteQuery gets the query and then i set the query manually below so that i have both jobs initialized there.
i had the first job working now i added the second job and my widjet fails.
the errors:
B4X:LogCat connected to: emulator-5554 ** Service (widgetservice) Create ** ** Service (widgetservice) Start ** startService: class simpletest.b4a.samples.homewidgets.httputils2service startService: class simpletest.b4a.samples.homewidgets.httputils2service ** Service (httputils2service) Create ** ** Service (httputils2service) Start ** ** Service (httputils2service) Start ** java.lang.Exception: Sub jobdone signature does not match expected signature. at simpletest.b4a.BA.raiseEvent2(BA.java:172) at simpletest.b4a.keywords.Common$5.run(Common.java:958) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4745) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method) java.lang.RuntimeException: java.lang.RuntimeException: java.lang.Exception: Sub jobdone signature does not match expected signature. at simpletest.b4a.keywords.Common$5.run(Common.java:961) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4745) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.RuntimeException: java.lang.Exception: Sub jobdone signature does not match expected signature. at simpletest.b4a.BA.raiseEvent2(BA.java:196) at simpletest.b4a.keywords.Common$5.run(Common.java:958) ... 9 more Caused by: java.lang.Exception: Sub jobdone signature does not match expected signature. at simpletest.b4a.BA.raiseEvent2(BA.java:172) ... 10 more ** Service (widgetservice) Create ** ** Service (widgetservice) Start ** startService: class simpletest.b4a.samples.homewidgets.httputils2service startService: class simpletest.b4a.samples.homewidgets.httputils2service ** Service (httputils2service) Create ** ** Service (httputils2service) Start ** ** Service (httputils2service) Start ** ** Activity (main) Create, isFirst = true ** ** Activity (main) Resume ** ** Activity (main) Pause, UserClosed = true ** ** Service (widgetservice) Start ** ** Service (widgetservice) Start ** ** Service (widgetservice) Start ** ** Service (widgetservice) Start ** ** Service (widgetservice) Start ** ** Service (widgetservice) Start ** ** Service (widgetservice) Destroy ** ** Service (httputils2service) Destroy ** ** Service (widgetservice) Create ** ** Service (widgetservice) Start ** startService: class simpletest.b4a.samples.homewidgets.httputils2service startService: class simpletest.b4a.samples.homewidgets.httputils2service
help ?