#Region Project Attributes
#ApplicationLabel: B4A TimerExample
#VersionCode: 1
#VersionName: 0.1
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#BridgeLogger: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim Timer1 As Timer
Dim iStejem As Int
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.
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("layout1")
If FirstTime Then
Log("Set timer.....")
Timer1.Initialize("Timer1_Tick", 2000)
Timer1.Enabled=True
If Timer1.IsInitialized Then Log("Timer1 is INIT OK") Else Log("Timer1 is NOT init OK")
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Timer1_Tick
Log("iStejem=" & iStejem)
iStejem=iStejem + 1
Timer1.Enabled=False
Timer1.Interval=2000
Timer1.Enabled=True
End Sub