-1

I can put 2 shortcuts on the lockscreen, and with every application installed on my android device. However, I need to unlock the screen when I slide one of those shortcuts, except for the camera: I don't need to unlock and when I close the camera the device shows the lockscreen again.

Now I want to create an application that the user can put in shortcut and opens without unlocking, like for the camera. How can I create that?

I don't want to root my smartphone or install other applications to change the lockscreen.

Thanks you!

  • 1
    Please, read [this (how to ask)](http://stackoverflow.com/help/how-to-ask) and [this (mcve)](http://stackoverflow.com/help/mcve) before asking, as those will help you get more and better answers from the community. – Bonatti Sep 28 '16 at 13:15
  • Sorry for my bad english and my troubles to explain my question. –  Sep 28 '16 at 13:32

1 Answers1

2

You cannot unlock the device however you can show an activity over lock screen.

Call this when your activity is launched:

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

Eugen Pechanec
  • 37,669
  • 7
  • 103
  • 124