If i start this app normal everything works fine i can reload the page over the button and the request will be sent to my server.
If i send this app to the background and reopen it over a link from a e-mail the page will loaded but when i click now to the reload button the app send no more request to my server until i have clicked a other link in the webview.
Can someone tell me what i did wrong ?
A quick demo is attached.
It is a mistake to call Activity.GetStartingIntent in Activity_Create. It should be done in Activity_Resume. You should also keep the intent in a global variable and make sure that it is actually a new intent.
i hope i have understand you right?
here my changed file:
The problem is still the same after start this app over intend the reload button does send the command webview1.load (i see this in the b4x log) but the request is not send to my server. I have first to click on a other link in this webpage then the reload request will work as expected
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private WebView1 As WebView
Private Button1 As B4XView
Private uri As String
Dim in As Intent
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime= True Then
Activity.LoadLayout("Layout")
If uri="" Then uri="https://kleinersonnenschein.eu/forum/forums/"
WebView1.LoadUrl(uri)
End If
End Sub
Sub Activity_Resume
Activity.LoadLayout("Layout")
in = Activity.GetStartingIntent 'GetIntent1
If in.Action = in.ACTION_VIEW Then
uri=in.GetData
Log (uri)
End If
If uri="" Then uri="https://kleinersonnenschein.eu/forum/forums/"
WebView1.LoadUrl(uri)
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
Log ("load :"&uri)
WebView1.LoadUrl(uri)
End Sub
Sub WebView1_PageFinished (url As String)
Log ("page loaded")
End Sub
Sub WebView1_OverrideUrl (url As String) As Boolean
Log (url)
End Sub