1

I need start activity over lock screen. It can be small activity on lock screen or fully new lock screen. It must start with lock button click

How to do this? I already have activity, broadcast reciver and service to do all job, but don't know how to put activity over lock screen.

kemmotar
  • 199
  • 2
  • 15

1 Answers1

3

In your Activity's onCreate(), before calling setContentView(), add this:

getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); 

For all the window flags you can set, refer to the documentation

A--C
  • 36,351
  • 10
  • 106
  • 92