Italian B4A - Mantenere attivo schermo

marco.canta

Active Member
Licensed User
Longtime User
Ciao, sto facendo un app di monitoraggio dati.
Mi occorrerebbe di mantenere lo schermo dello smartphone o tablet, acceso e attivo mentre e in funzione l'app.
Ce modo di evitare che lo schermo si spenga ad app in funzione ?

Grazie
Marco
 

udg

Expert
Licensed User
Longtime User
Altre modalità per mantenere "acceso" lo schermo le trovi leggendo questo thread su stackoverflow

Per attivare il WakeLock da codice:
B4X:
Dim wake As PhoneWakeState 'ignore. this will add the required permission
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim WakeLock As JavaObject
WakeLock = ctxt.RunMethodJO("getSystemService", Array("power")).RunMethod("newWakeLock", Array(1, "LocationManagerService"))
WakeLock.RunMethod("acquire", Null)
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…