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

亡梦爱人 提交于 2019-12-25 10:49:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!