Hi,
I'm need to launch an activity from a foreground service and, if the lock screen is active (even a password-protected one) I need the activity to show, but it's proving very problematic. Here is the code I'm using:
Dim r As Reflector
r.Target = r.GetActivity
r.Target = r.RunMethod("getWindow")
Dim flag As Int = Bit.OR(Bit.OR(Bit.OR(MyFunctions.FLAG_SHOW_WHEN_LOCKED, MyFunctions.FLAG_TURN_SCREEN_ON), MyFunctions.FLAG_KEEP_SCREEN_ON), MyFunctions.FLAG_FULLSCREEN)
flag = Bit.OR(flag, MyFunctions.FLAG_ACTIVITY_SINGLE_TOP)
flag = Bit.OR(flag, MyFunctions.FLAG_DISMISS_KEYGUARD)
r.RunMethod2("addFlags", flag, "java.lang.int")
I am using this code in the Activity_Create method, but it has no effect. Any ideas?
Cheers,
Richard
I'm need to launch an activity from a foreground service and, if the lock screen is active (even a password-protected one) I need the activity to show, but it's proving very problematic. Here is the code I'm using:
Dim r As Reflector
r.Target = r.GetActivity
r.Target = r.RunMethod("getWindow")
Dim flag As Int = Bit.OR(Bit.OR(Bit.OR(MyFunctions.FLAG_SHOW_WHEN_LOCKED, MyFunctions.FLAG_TURN_SCREEN_ON), MyFunctions.FLAG_KEEP_SCREEN_ON), MyFunctions.FLAG_FULLSCREEN)
flag = Bit.OR(flag, MyFunctions.FLAG_ACTIVITY_SINGLE_TOP)
flag = Bit.OR(flag, MyFunctions.FLAG_DISMISS_KEYGUARD)
r.RunMethod2("addFlags", flag, "java.lang.int")
I am using this code in the Activity_Create method, but it has no effect. Any ideas?
Cheers,
Richard