Keep app running

Shay

Well-Known Member
Licensed User
Longtime User
Hi

have timer, and after 1 minute my screen is turning off
how can i keep my app running while screen is off
(have timer running in my app and i want it will continue to run)
 

Jim T

Member
Licensed User
Longtime User
If it is a short term timer, like one I made, you might use the KeepAlive function. You need to be sure to release it when your app is done. Basically, it stops the screen from turning off until your app is over. I like this because I need to keep an eye on my timer. Here is the code that I gleaned from the forum:

Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim Awake As PhoneWakeState

Sub Activity_Create(FirstTime As Boolean)
Awake.KeepAlive(True)

Sub Activity_Pause (UserClosed As Boolean)
Awake.ReleaseKeepAlive
End Sub

Jim T
 
Upvote 0
Top