Android Question Problem with WaitFor - Object context is paused (HttpJob)

Discussion in 'Android Questions' started by FabioC6, Aug 29, 2018.

  1. FabioC6

    FabioC6 Member Licensed User

    Hello,
    I'm trying to interrogate a webservice using HttpJob with the code below, but it keeps displaying this message "Object context is paused. Ignoring CallSubDelayed: JobDone".
    I have another function in this class which does basically the same thing and it works fine.
    What am I missing?

    Thanks.


    Code:
    Sub GetMenu(Component As Object)
        
    Dim job1 As HttpJob
        job1.Initialize(
    "Job1", Me)
     
        job1.Download(
    Address)
        job1.GetRequest.SetHeader(
    "Authorization","Basic " & GetHash)
     
        
    Wait for JobDone (Job As HttpJob)
        
    Try
            
    If Job.Success Then
                
    CallSub2(Component,"SetMenu",Job.GetString)
            
    End If
        
    Catch
            
    Log(LastException)
        
    End Try
    End Sub
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Initialize this class from the starter service. This way it will never be paused.
     
  3. FabioC6

    FabioC6 Member Licensed User

    Ahh got it, so that was because the activity that has initialized the class was paused?

    Thank you Erel, that did the trick.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Yes.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice