Hi guys,
i've a problem.
I've this in the Activity_Create
Then, in the Service Module named "HeavyTasks" i've this:
The problem is that the "Add" sub in the HeavyTasks module is NEVER fired, and the app deadlock there...
If i use CallSubDelayed it works, but i can't use waitfor...
Thanks in advance
i've a problem.
I've this in the Activity_Create
B4X:
Dim r As ResultSet = Starter.FileManager1.SQL1.ExecQuery("SELECT RowID FROM xxx")
If r.RowCount < 7903 Then 'se il DB è vuoto
Wait For (CallSub2(HeavyTasks, "Add", Array As Object("xxx", "ALL", True))) Complete
End If
r.Close
Then, in the Service Module named "HeavyTasks" i've this:
B4X:
Public Sub Add(Params() As Object) As ResumableSub
'Type 0, Input 1, Sync 2
queue.Add(CreateMap("Tipo":Params(0), "Input":Params(1)))
Log(queue)
If Not(Downloading) Then
Wait For (DownloadDB(Params(2))) Complete (r As Boolean)
End If
Return r
End Sub
Public Sub DownloadDB(Sync As Boolean) As ResumableSub
... do things ...
Return True
End Sub
The problem is that the "Add" sub in the HeavyTasks module is NEVER fired, and the app deadlock there...
If i use CallSubDelayed it works, but i can't use waitfor...
Thanks in advance