Android Question how to recover variable from JobDone

Isac

Active Member
Licensed User
Longtime User

What would I like to do?

I want to recover the password from my server to run a check

what is the problem?

The data is retrieved correctly from the server,
but when I start the activity the variable controllo is always empty
in JobDone the variable is recovered correctly.




B4X:
Sub Process_Globals

    Public controllo As String

End Sub



Sub Activity_Create(FirstTime As Boolean)

    Activity.LoadLayout("Layout1")
    ricserver
    Log( "value1:"&controllo)
    If  controllo ="workinprogress" Then  
   
----------------------------------------------------------
----------------------------------------------------------

    Else
--------------------------------------------------------
--------------------------------------------------------

    End If


End Sub


Sub ricserver
  
    Dim workinprogress As HttpJob
    workinprogress.Initialize("workinprogress",Me)
    workinprogress.Download2("http://www.-----------------/password.php", Array As String("action","workinprogress"))
End Sub


Sub JobDone (Job As HttpJob) 
    ProgressDialogHide
    If Job.Success Then
  
        res = Job.GetString
        Log("Back from Job:" & Job.JobName )
        Log("Response from server: " & res)
      
        Dim parser  As JSONParser
        parser.Initialize(res)
  
        Select Job.JobName
            Case "workinprogress"
              
                Log(Job.GetString)
                Dim root As List = parser.NextArray
                For Each colroot As Map In root
                    controllo = colroot.Get("controllo")
                    Log("value2:"&controllo)
                  
                  
                Next
              
        End Select
 ----------------------------
-------------------------
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
What is the EXACT result from the Server?

Log("Response from server: " & res)

What is the output?
 
Upvote 0
Top