Reputation: 319
I want to create an activity that float over the lock screen and do something with it, I think there is an order in which every app will appear one over another, but I don't know how. So i want to have both KeyGuard(will be always enable) and activity showing, so if the activity will have an transluscent theme(invisible background), the keyguard will be visible behind.
There is a way to create an activity that float over the lock screen? Thanks.
I tried this: Android activity over default lock screen, and similar solutions but with no luck.
Upvotes: 1
Views: 2108
Reputation: 29
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON|
WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD|
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED|
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
Just add the above code to your onCreate() function.
Upvotes: 2
Reputation: 74790
This is not possible.
If 3rd party developers could put any activity on top of lock screen, what would be the purpose of lock screen after all?
On the other side, developers could trick users into thinking that current lock screen is authentic while they are not. And even could sniff user name and password (f.e. with pattern lock screen, when you've tried more then 30 times you need to enter the password to unlock).
The most developers can expect in future versions is the ability to add custom views into lock screen (something like in notification bar). But that is just my speculations.
Upvotes: -1