-1

How can I make my app usable when device is locked? Like when a timer/alarm goes off, I want it to be possible to access the entire app without unlocking the device.

arberg
  • 4,148
  • 4
  • 31
  • 39

1 Answers1

0

Here's a different question where the question doesn't really make sense due to permissions, but the accepted answer is exactly what I was looking for. See linked question for details about below code.

    Window window = this.getWindow();
    window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
    window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);

To implement an alarm see Background jobs: AlarmManager

arberg
  • 4,148
  • 4
  • 31
  • 39