M MikeSimpson Member Licensed User Longtime User Sep 12, 2014 #1 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: Code: 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: Code: 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 Code: 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?
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: Code: 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: Code: 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 Code: 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?
LucaMs Expert Licensed User Longtime User Sep 12, 2014 #2 Try: Code: Sub Activity_Pause (UserClosed As Boolean) If UserClosed Then Awake.ReleaseKeepAlive End If End Sub Upvote 0
Try: Code: Sub Activity_Pause (UserClosed As Boolean) If UserClosed Then Awake.ReleaseKeepAlive End If End Sub