Sub Activity_Resume
If isAutentic = True Then
Activity.LoadLayout("MainLayout")
Activity.AddMenuItem("Grafice", "ShowGrafice")
Activity.AddMenuItem("Valori", "TabelValori")
Else
Activity.RemoveAllViews
Activity.LoadLayout("LoginLayout")
End If
End Sub
Sub ButtonLogin_Click
Dim un As String = ""
Dim psw As String = ""
un = EditUsername.Text.Trim
psw = EditParola.Text.Trim
CheckLogin(un, psw)
End Sub
Sub CheckLogin(un As String, psw As String)
..........
if condition then
isAutentic = true
Activity.RemoveAllViews
Activity.LoadLayout("MainLayout")
Activity.AddMenuItem("Grafice", "ShowGrafice")
Activity.AddMenuItem("Valori", "TabelValori")
end if
End sub