your action. a. b. c. There are some limitations when it comes to a locked device though. When isLocked() returns true, you won’t be able to display a dialog and activities must have set FLAG_SHOW_WHEN_LOCKED to display above the lock screen. The unlockAndRun() method can be used to prompt the user to unlock their device, allowing you to run code (such as displaying a dialog) only after they’ve unlocked their device. startActivityAndCollapse