Hi all
I have a very strange problem.
Here is a code
Let's say I cleaned the project before running this code. It works fine. Then if do any changes in GetLegal sub, for example changed a text in Log("Finish=================================================Finish")
to Log("Finish 123=================================================Finish")
and just run the project.. Project starts and if I clock on a button to call the GetLegal sub the code stops on this line j.PostString(URL,"whattodo=gettos") and doesn't go anywhere. You can put any URL you want.
Then I cleaned the project again, start the project - it works.
I've been using HTTPJob in my B4i app for years and never had any problems.
What am I doing wrong?
Please see the attached project code and libs I'm using
Thanks
I have a very strange problem.
Here is a code
B4X:
'Code module
#Region Project Attributes
#ApplicationLabel: B4i Internet
#Version: 1.0.0
'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
#iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
#iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
#Target: iPhone, iPad
#ATSEnabled: True
#MinVersion: 16
#ProvisionFile: EVVProfile.mobileprovision
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Private xui As XUI
Private HUD As HUD
Private TOSStr As String
Private wvDemo As WebView
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.RootPanel.LoadLayout("Page1")
NavControl.ShowPage(Page1)
End Sub
Sub Button1_Click
GetLegal
End Sub
Private Sub Page1_Appear
Try
Catch
Log(LastException)
End Try
End Sub
Private Sub Page1_Resize(Width As Int, Height As Int)
End Sub
Private Sub GetLegal
Try
Dim j As HttpJob
Dim str As String
Dim URL As String="https://hcmsemr.com/medical-billing-services-privacy-policy"
HUD.ProgressDialogShow("Starting")
Log("Start =================================================Start")
j.Initialize("",Me)
j.PostString(URL,"whattodo=gettos")
Wait For(j) JobDone(j As HttpJob)
If j.Success Then
str=j.GetString
TOSStr=str
Log("TOS=" & TOSStr)
Else
Msgbox("Please check your Internet connection","HCMS")
str="NoConnection"
End If
j.Release
If str="NoConnection" Then
Log("NoConnection")
End If
HUD.ProgressDialogHide
Log("Finish=================================================Finish")
wvDemo.LoadHtml(TOSStr)
Catch
Log("GetLegal " & LastException)
End Try
End Sub
Let's say I cleaned the project before running this code. It works fine. Then if do any changes in GetLegal sub, for example changed a text in Log("Finish=================================================Finish")
to Log("Finish 123=================================================Finish")
and just run the project.. Project starts and if I clock on a button to call the GetLegal sub the code stops on this line j.PostString(URL,"whattodo=gettos") and doesn't go anywhere. You can put any URL you want.
Then I cleaned the project again, start the project - it works.
I've been using HTTPJob in my B4i app for years and never had any problems.
What am I doing wrong?
Please see the attached project code and libs I'm using
Thanks