tags:

views:

312

answers:

1

Hi everyone, I'm making a popup in Android using Toast, is there any way when shown to blur the window behind. I'd usually use:

getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,  
                     WindowManager.LayoutParams.FLAG_BLUR_BEHIND);

But in this case am not sure how to go about it... Any help would be great, thanks!

+1  A: 

A Toast is designed to be unobtrusive and only appears for a short time so blurring the background would stop the user from continuing to use the phone. From the Android SDK:

When the view is shown to the user, appears as a floating view over the application. It will never receive focus. The user will probably be in the middle of typing something else. The idea is to be as unobtrusive as possible, while still showing the user the information you want them to see. Two examples are the volume control, and the brief message saying that your settings have been saved.

You would be better using a Dialog if you want to guarantee the user's attention, you should then be able to blur the background:

http://developer.android.com/guide/topics/ui/dialogs.html

AshtonBRSC