I get the following Android exception when I try to open a dialog. Can someone please help me understand what is going on and how can I fix this problem?
You can continue to use getApplicationContext(), but before use, you should add this flag: dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT), and the error will not show.