'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
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.
Dim tmr As Timer
Dim cmd As Button
Dim intrv As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
' we need this to the manifest
' AddPermission(android.permission.EXPAND_STATUS_BAR)
cmd.Initialize ("cmd")
cmd.Text="Expand for some secs"
Activity.AddView (cmd,20%x,30%y,60%x,40%y)
tmr.Initialize ("tmr",100)
tmr.Enabled =True
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub cmd_click
expandCollapseStatusBar (True)
End Sub
Sub tmr_tick
If intrv<1 Then
expandCollapseStatusBar(False)
Else
intrv=intrv-1
End If
End Sub
Sub expandCollapseStatusBar(choice As Boolean )
Dim r As Reflector
r.Target =r.GetContext
r.target=r.RunMethod2("getSystemService","statusbar","java.lang.String")
If choice Then
intrv=100
r.RunMethod ("expand")
Else
r.RunMethod ("collapse")
End If
End Sub