I\'m trying to open a dialog window, but every time I try to open it it throws this exception:
Uncaught handler: thread main exiting due to uncaught exceptio
Another solution is to set the window type to a system dialog:
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
This requires the SYSTEM_ALERT_WINDOW permission:
As the docs say:
Very few applications should use this permission; these windows are intended for system-level interaction with the user.
This is a solution you should only use if you require a dialog that's not attached to an activity.