Hello,
I would like to intercept error 404 or ERR_ADDRESS_UNREACHABLE when using the webview, I do not know how to do it, I looked in the forum and I followed the several examples
But none worked so I would like to know if someone can please help me, my code is simple:
Could you tell me how I could do to intercept these errors?, I have no idea how to do this
I would like to intercept error 404 or ERR_ADDRESS_UNREACHABLE when using the webview, I do not know how to do it, I looked in the forum and I followed the several examples
But none worked so I would like to know if someone can please help me, my code is simple:
B4X:
#Region Project Attributes
#ApplicationLabel: mobiPedido
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: True
#End Region
#Region Activity Attributes
#FullScreen: True
#IncludeTitle: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim WebView1 As WebView
Dim WebAddress As String
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("webnav")
WebAddress = "http://app.mobipedido.com.br/mobipedido.dll/m?telefone=5123456789"
'Endereco = "http://192.168.15.14:8080/m?telefone=5123456789"
ProgressDialogShow2("C o n e c t a n d o ...",True)
WebView1.LoadUrl(WebAddress)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
If KeyCode = KeyCodes.KEYCODE_BACK Then
Dim I As Int
i = Msgbox2("Tem certeza que deseja sair do aplicativo?", "Sair do aplicativo", "SIM", "NÃO", "", Null)
If i = DialogResponse.POSITIVE Then Return False
If i = DialogResponse.NEGATIVE Then Return True
Return True
End If
End Sub
Sub WebView1_PageFinished (Url As String)
ProgressDialogHide
End Sub
Could you tell me how I could do to intercept these errors?, I have no idea how to do this
Last edited: