Sub Activity_Create(FirstTime As Boolean)
Dim ph As Phone
Dim bd As BitmapDrawable
Activity.LoadLayout("layout")
ph.SetScreenOrientation (1)
If FirstTime=True Then
Ventana
GrabaTExto
End If
'''
bd = ph.GetResourceDrawable(17301569)
Activity.AddMenuItem2 ("Acerca de..","Button3", bd.Bitmap)
bd = ph.GetResourceDrawable(17301560)
Activity.AddMenuItem2("Salir","Button4", bd.Bitmap)
End Sub
Sub Activity_KeyPress(KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
Dim ph As Phone
Dim bd As BitmapDrawable
bd = ph.GetResourceDrawable(17301659)
tmpValue="Desea salir de la aplicación?: "
result=Msgbox2(tmpValue,"","Aceptar","Cancelar","",bd.Bitmap)
If result=DialogResponse.POSITIVE Then
Activity.Finish
Else
Return True
End If
Else If KeyCode = KeyCodes.KEYCODE_MENU Then
'nothing
Else
Return True ' con esto vuelves al programa, si no pones nada sale de el
End If
End Sub
Sub bMenu_Click
Dim KC As Int
KC = KeyCodes.KEYCODE_MENU
Activity_KeyPress (KC)
End Sub