Show dialog with touch events over lockscreen in Android 2.3

后端 未结 3 1725
陌清茗
陌清茗 2021-01-12 10:56

I want to build a dialog which is visible on the lockscreen and can receive touch events. I built a window with WindowManager but only the TYPE_SYSTEM_OVE

3条回答
  •  暖寄归人
    2021-01-12 11:16

    I do not think you can launch an activity each time when device is locked without binding your application as admin privilaged app programatically.

    Once your app is admin privilaged app, you can programatically set password & lock the screen & then programatically unlock it using Device Policy Manager.

    On top of that lock screen you can programatically launch your own activity & you can create your own unlocker & unlock device through that activity as you can get call backs via DeviceAdminReceiver.

    Here is a good example for that & all you need is to create your own activity after you called DevicePolicyManager.lockNow(). Then it will appear on top of lock screen as normal activity plus extra control over native lockscreen.

提交回复
热议问题