Sub Process_Globals
Private ProximityWakeLock As JavaObject
End Sub
Sub Service_Create
If ProximityWakeLock.IsInitialized = False Then
Dim ctxt As JavaObject
ProximityWakeLock = ctxt.InitializeContext.RunMethodJO("getSystemService", Array("power")) _
.RunMethod("newWakeLock", Array(32, "proximity"))
ProximityWakeLock.RunMethod("acquire", Null)
'release code:
'ProximityWakeLock.RunMethod("release", Null)
End If
End Sub