Android Question Wait For (JOB) JobDone(JOB As HttpJob) closed the sub with out Exception

Martin Domian

Member
Licensed User
Longtime User
A very interesting case that I have presented here in the summarized code. The request runs perfectly. At the moment, however, I am on an island where the internet gets very bad towards the evening and also behaves strangely.

Then it actually happens that the line in which Job.Access is evaluated is no longer reached. The entire sub is terminated without an error message. Removing Try/Catch doesn't help either.

What could this be and how can you give the user a useful message


B4A:
private Sub LoadProjects
    
    Dim JOB As HttpJob, URL As String, F As String
    
    Try
        JOB.Initialize("PROJECTS", Me)
        JOB.PostString (URL,txt)
        JOB.GetRequest.SetHeader("User-Agent","Request Android App")
 
        Wait For (JOB) JobDone(JOB As HttpJob)
        If JOB.Success = True Then
            Dim X As JSONParser, M As Map, F As String
            F = JOB.GetString
            :
            :
        Else
          ToastMessageShow ("Error: " & JOB.ErrorMessage,False)
        End If
    Catch
        ToastMessageShow (LastException.message,False)
    End Try
    If JOB.IsInitialized Then JOB.Release
    
End Sub
 
Top