'service module
Sub Service_Start (StartingIntent As Intent)
Dim p As PhoneWakeState
Log("releasing KeepAlive")
p.ReleaseKeepAlive
Log("turning screen on")
p.KeepAlive(True)
Log("using partialLock")
p.PartialLock
StartActivity(Activity1) ' start the activity
' destroy this service once the activity is started.
StopService("")
End Sub
' Activity module
Sub Activity_Pause (UserClosed As Boolean)
If UserClosed = True then
Dim p As PhoneWakeState
p.ReleaseKeepAlive
p.ReleasePartialLock
End If
End Sub