Background not blur activity in ICS api level 14 when open dialog in android

2k views Asked by At

I making apps for background image blur when open dialog on button click event and its working for api level 8(Gingerbread) and api level 14 (ICS) not background image blur its only dimming background like on light black, what i do, Thanks for in Advance

This is code working on Android 2.3 and 4.0 not working,

    AlertDialog alertDialog = alertDialogBuilder.create();
    WindowManager.LayoutParams lp = alertDialog.getWindow().getAttributes();  
    lp.dimAmount=0.0f;  
    alertDialog.getWindow().setAttributes(lp);  
    alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);  
    alertDialog.show();
2

There are 2 answers

2
Tarun On BEST ANSWER

FLAG_BLUR_BEHIND was deprecated in API level 14.

Blurring is no longer supported.

As per Dianne Hackborn Android framework engineer

I recommend avoiding this. Back in the G1 days the blur effect could be implemented somewhat efficiently in software. Those days are long past. This is something you should avoid until at some point in the future when it is done on the GPU.

0
Onur A. On

FLAG_BLUR_BEHIND is deprecated at API Level 14 that's why it works on 2.3 and not on 4.0