问题
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();
回答1:
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.
回答2:
FLAG_BLUR_BEHIND
is deprecated at API Level 14 that's why it works on 2.3 and not on 4.0
来源:https://stackoverflow.com/questions/18570034/background-not-blur-activity-in-ics-api-level-14-when-open-dialog-in-android