20

I can see that when I use the same flag as shown on the API-demos for blurring the background, I get a warning that it's deprecated:

"The field WindowManager.LayoutParams.FLAG_BLUR_BEHIND is deprecated".

I've read about it, and I've found that "Blurring is no longer supported".

Does it mean that it won't work on future versions? Why did they deprecate it? Is there an alternative? I really like this feature.

halfer
  • 19,824
  • 17
  • 99
  • 186
android developer
  • 114,585
  • 152
  • 739
  • 1,270
  • 1
    https://groups.google.com/forum/?fromgroups#!topic/android-developers/LY4MoxxA_MM says it does not work anymore and you can't replace it – zapl Apr 29 '12 at 13:22
  • is there an alternative which would use the GPU/CPU for this? – android developer Apr 29 '12 at 17:40
  • 1
    You can probably write your own if you take a screenshot of the current screen, blur that and use it as background to your dialog or something like that but there is afaik nothing built-in – zapl Apr 29 '12 at 17:45

3 Answers3

10

ok , there is probably no alternative that uses the API , unless maybe i've forgetting anything.

i can however use dimming , which is cool too, as written here:

WindowManager.LayoutParams lp = dialog.getWindow().getAttributes();  
lp.dimAmount=0.0f;  
dialog.getWindow().setAttributes(lp);  
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);  
android developer
  • 114,585
  • 152
  • 739
  • 1,270
2

watch out that

WindowManager.LayoutParams.FLAG_BLUR_BEHIND

is deprecated.. (at least at Android 4.0 it leads to a black screen in background...)

Reference (Source): http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html

int FLAG_BLUR_BEHIND This constant is deprecated. Blurring is no longer supported.

public static final int FLAG_BLUR_BEHIND

Since: API Level 1
This constant is deprecated.
Blurring is no longer supported.

Window flag: blur everything behind this window.

Constant Value: 4 (0x00000004)

what a pitty .. :( (was a nice effect ;))

cV2
  • 5,229
  • 3
  • 43
  • 53
  • 1
    how come ? it's a cool effect. also , how do you know (in the API website) from which version this constant is deprecated? in addition , what would happen if i use it on android 4? – android developer Jun 28 '12 at 23:20
  • if u use it on android 4.0 the background is not blurred, it's straight black, no effect at all, also doesnt look very well, because on all other devices it's nicely blurred ... to your other question, i edited my answer above: look there: ) – cV2 Jun 29 '12 at 13:57
  • the link you gave is the API website , which is the one i've read about . they don't say from which version of android this feature is not available ... – android developer Jun 29 '12 at 19:34
  • sry no idea exactly, but first time i realized it was with android 4.0 – cV2 Aug 01 '12 at 11:34
  • 15
    you know , it's weird that the API website doesn't tell anything about deprecated things . they should add a description of why it's deprecated , alternatives , and from which version it's deprecated. – android developer Aug 01 '12 at 11:54
  • hehe ;) yeah definitly, would be much more better :) interesting :) easier :) - each and every thing u mentioned :) – cV2 Aug 01 '12 at 11:59
  • Funnier is the fact that iOS 7 currently integrates it as a native functionality. – Léon Pelletier Feb 26 '14 at 21:38
  • :( ;=) .... there are several algorithms to create a blurred screenshot and just show it (but much effort and high performance needed :() – cV2 Feb 27 '14 at 09:31
-1

I Think u should try ShowCaseView Library. For Highlighting the Elements on Android.

The ShowcaseView library is designed to highlight and showcase specific parts of apps to the user with a distinctive and attractive overlay. This library is great for pointing out points of interest for users, gestures, or obscure but useful items.

Github Link : https://github.com/amlcurran/ShowcaseView