I am building an app with multiple Activities and don't want the phone to go to sleep when the app is active.
If I use:
Dim Awake As PhoneWakeState
Sub Activity_Create(FirstTime As Boolean)
Awake.KeepAlive(True)
in the main activity, it is working, but the phone stays alive also after I ended the app. So I have to use:
Sub Activity_Pause (UserClosed As Boolean)
Awake.ReleaseKeepAlive
End Sub
to kill KeepAlive.
But then the phone keeps going to sleep, if I call another activity.
Do I have to use
Awake.KeepAlive(True)
and
Awake.ReleaseKeepAlive
in every activity or is there a way to call "ReleaseKeepAlive" when I exit an app, not only when I end an activity?