Android Question Wake up with partial lock

hatzisn

Well-Known Member
Licensed User
Longtime User
Hi everyone,

I was wondering if it is possible to wake up from sleep and open an activity if a service is started with partial lock and foreground... I would try it with a trial application but it is getting really late and I will not be getting up in the morning if I don't "enter in sleep mode" :) immediately. But I really would like to know if someone has tried it and succeed it.

Thanks in advance...
 

DonManfred

Expert
Licensed User
Longtime User
B4X:
    SetShowWhenLocked
    p.KeepAlive(False)


[..]

Sub SetShowWhenLocked
   Dim r As Reflector
   r.Target = r.GetActivity
   r.Target = r.RunMethod("getWindow")
   r.RunMethod2("addFlags", 6815872, "java.lang.int")
End Sub

Nake sure to set a partial lock in forehand...
 
Upvote 0

hatzisn

Well-Known Member
Licensed User
Longtime User
Thanks DonManfred. I will try it a.s.a.p...
 
Upvote 0
Top