Android Question Problem with Sub JobDone (job As HttpJob)

bixmatech

Member
Licensed User
Dear,
Can I know where is the problem with this code? Thanks
B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim job As HttpJob
    Dim ConnexioInternet As Boolean
End Sub

Sub JobDone (job As HttpJob)
    If job.JobName="Job1" And job.Success=False Then
        ConnexioInternet = False
    Else
        ConnexioInternet = True
    End If
    job.Release
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    myfunction
    job.Initialize("Job1", Me)
    job.Download("http://www.google.com")
End Sub

Sub myfunction
    Dim myw As WebView
    myw.Initialize("myw")
    Activity.AddView(myw, 0, 0, 100%x, 100%y) 'Your options for size here
    myw.LoadUrl("http://www.stackoverflow.com")
End Sub
 

bixmatech

Member
Licensed User
Error description: Parameter name cannot hide global variable name.
Occurred on line: 28 (Main)
Sub JobDone (job As HttpJob)
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Parameter in jobdone should have a different name than job since you used it for the global var.
 
Upvote 0
Top