Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private Wbe As WebViewExtras
Private Navegador As WebView
Private ChromeClient As DefaultWebChromeClient
Private Logo As ImageView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Cargamos el Layout
Activity.LoadLayout("Main")
'Inicializamos cosas
Wbe.Initialize(Navegador)
ChromeClient.Initialize("ChromeCLient")
'Hacemos cosas
Wbe.SetWebChromeClient(ChromeClient)
Navegador.LoadUrl("http://mydomain.com")
End Sub
Sub Activity_KeyPress(KeyCode As Int) As Boolean
'Actuamos con el boton atras en funcion de en qué página estemos
Select KeyCode
Case KeyCodes.KEYCODE_BACK
If Navegador.Url = "http://mydomain.com/home" Or Navegador.Url = "http://mydomain.com/" Then
ExitApplication
End If
If Wbe.CanGoback Then
Navegador.Back
Return True
Else
Navegador.LoadUrl("http://mydomain.com")
Return True
End If
End Select