4

I use a popupwindow for displaying options in Android. I tried to dim/blur the activity when a popupwindow is active, but I did not find a solution... can anybody help me.

I used the following code but it does not work for me.

getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
jro
  • 9,300
  • 2
  • 32
  • 37
Gopi
  • 171
  • 3
  • 8

1 Answers1

2

Use it like this:

WindowManager.LayoutParams lp = dialog.getWindow().getAttributes();  
lp.dimAmount=0.0f;  
dialog.getWindow().setAttributes(lp);  
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);  
Caner
  • 57,267
  • 35
  • 174
  • 180
  • 1
    Thanks LAS_VEGAS for giving response. but i used the above code but it is not working with popup window in android. – Gopi Dec 07 '11 at 11:55
  • I am also looking for a way to blur the background when a popup window is displayed. Anyone come up with this solution yet? – Nick Jan 11 '12 at 17:33