Idea taken from Android: Blurring and dimming background windows from dialog. I\'m having trouble getting the content under my dialog to blur. When calling eula.getWindow(
getWindow()
is a method of the dialog class, not of the dialog builder. Your code should rather look like this:
AlertDialog dlg = eula.show();
WindowManager.LayoutParams lp = dlg.getWindow().getAttributes();
lp.dimAmount = 0.0F;
dlg.getWindow().setAttributes(lp);
dlg.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
Note though that the FLAG_BLUR_BEHIND
constant is deprecated now, blurring behind windows is no longer supported. So your code might break in the future.