My Activity is trying to create an AlertDialog which requires a Context as a parameter. This works as expected if I use:
AlertDialog.Builder builder = new Al
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.
getApplicationContext()
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT)
Add the following permission to your manifest: