K konisek Member Licensed User Longtime User Dec 26, 2024 #1 How to keep the screen always on during running my app? Before I used B4X: Dim pw As PhoneWakeState pw.KeepAlive(True) 'Display on, bright
How to keep the screen always on during running my app? Before I used B4X: Dim pw As PhoneWakeState pw.KeepAlive(True) 'Display on, bright
aminoacid Active Member Licensed User Longtime User Dec 26, 2024 #2 konisek said: How to keep the screen always on during running my app? Before I used B4X: Dim pw As PhoneWakeState pw.KeepAlive(True) 'Display on, bright Click to expand... It should still work. It works for me! Just make sure that "pw.KeepAlive(True)" is placed in Activity_Create Last edited: Dec 27, 2024 Upvote 0
konisek said: How to keep the screen always on during running my app? Before I used B4X: Dim pw As PhoneWakeState pw.KeepAlive(True) 'Display on, bright Click to expand... It should still work. It works for me! Just make sure that "pw.KeepAlive(True)" is placed in Activity_Create
BlueVision Well-Known Member Licensed User Longtime User Dec 27, 2024 #3 Also works for me here with Android 14. One thing that has never worked for me is the direct switching between dimmed and undimmed wakelock: B4X: Dim pw As PhoneWakeState pw.KeepAlive(True) ‘Display on, bright then later at some point: (and this does not work!) B4X: pw.KeepAlive(False) ‘Display on, dimmed To make it work, you have to release the wakelock first. So the correct code is: B4X: pw.ReleaseKeepAlive pw.KeepAlive(False) ‘Display on, dimmed Upvote 0
Also works for me here with Android 14. One thing that has never worked for me is the direct switching between dimmed and undimmed wakelock: B4X: Dim pw As PhoneWakeState pw.KeepAlive(True) ‘Display on, bright then later at some point: (and this does not work!) B4X: pw.KeepAlive(False) ‘Display on, dimmed To make it work, you have to release the wakelock first. So the correct code is: B4X: pw.ReleaseKeepAlive pw.KeepAlive(False) ‘Display on, dimmed