Android Question Dismiss screen lock and launch app from service

BKuvaki

Member
Licensed User
Longtime User
Hi Everybody,

Maybe this does not need a new Thread but...

I want to launch a app and show it before the lock screen out of a service module.

The ShowWhenLocked code (see below) only runs in a activity module but not in a service module.
So what do I have do to for getting around this issue?

Can anybody help me?

Sub SetShowWhenLockedDim r AsReflector
r.Target = r.GetActivity
r.Target = r.RunMethod("getWindow")
r.RunMethod2("addFlags", 6815872, "java.lang.int")End Sub

Thanks in advance
 
Last edited:

BKuvaki

Member
Licensed User
Longtime User
p
You need to start the activity from the service and run this code from Activity_Create sub.

Thank you for your reply.

This is what I have already tested: From the Service I wake up the phone and start the activity-x over the lock screen. So far all fine. In the Activity_Create Sub
in activity-x I call ShowWhenLocked then I wait 5 seconds (timer) and then I try to start the 3rd party app with PackageManager:

In = pm.GetApplicationIntent(3rdPartyAppPackage)
If In.IsInitialized Then
StartActivity(In)
End If

The result: activity-x opens over the lock Screen, the 3rd Party app also opens but remains behind the lock Screen. (when I unlock I can see the app running)

But I want to open the 3rd party app directly from the Service and Show it over the lock Screen.
 
Last edited:
Upvote 0

BKuvaki

Member
Licensed User
Longtime User
Hi Erel,

Thank you for the advice.
Really tried every possible combination according to the link above, but no way (maybe Android 5.X.X does not Support any more)
As soon as my "Proxy" app finishes the lock Screen comes back and my 3rd party app is behind it.

is there no way with reflection library to have
r.Target =r.GetService instead of r.Target =r.GetActivity

Thanks in advance.
 
Upvote 0
Top