Android: Unable to add window. Permission denied for this window type
I'm working on an app where I need to display a window with some info ON the Lock Screen (KeyGuard) without unlocking the phone. I figured I could probably do it with WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG But every time my app crashes with the following error: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@40ec8528 -- permission denied for this window type These posts ( here , here and here ) all give the same answer. To add the following permission in the Manifest file. android.permission.SYSTEM_ALERT_WINDOW Solution that I have