Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Page1, Page2, Page3 As Panel ' Declares the three panels
Dim TabHost1 As TabHost ' Declares the TabHost view
Private fbbutton, twbutton, localiza, camara As Button ' Declares the buttons
Private vistaweb As WebView ' Declares the WebView
Private textoedit As EditText ' Declares the EditText
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")
Activity.LoadLayout("main") ' Loads "Main" layout file
TabHost1.AddTab("Principal", "Page1") ' Adds Page1 on the first Tab
TabHost1.AddTab("Navegador", "Page2") ' Adds Page2 on the second Tab
TabHost1.AddTab("Otros", "Page3") ' Adds Page3 on the third Tab
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
Activity.Finish
End Sub
Sub TabHost1_TabChanged
Activity.Title = "Current Tab = " & TabHost1.CurrentTab 'Shows currentab
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
Dim Answ As Int
If KeyCode = KeyCodes.KEYCODE_BACK Then
Answ = Msgbox2("¿Quieres salir?", _
"PetPopular", "Yes", "", "No", Null)
If Answ = DialogResponse.NEGATIVE Then
Return True
End If
End If
Return False
End Sub