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
adding
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
and
"android.permission.SYSTEM_ALERT_WINDOW"/> in manifest
"android.permission.SYSTEM_ALERT_WINDOW"/>
It works for me now. After even close and open the application, gave me the error at that time.