Android toast blur
Asked Answered
F

1

0

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!

Filomena answered 24/10, 2009 at 17:35 Comment(0)
P
3

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

Penates answered 25/10, 2009 at 15:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.