How to blur the background of a search dialog box?

Ive created search activity in my application on a standard Android path without any special offers. When the user starts typing or clicks the search button, they get a search dialog box with a search field, something like Figure 1 from here:

http://developer.android.com/guide/topics/search/search-dialog.html

In the background, you will see previous activity, the words "comply", etc.

My problem is that the previous activity is shown as the day after the search dialog, and it confuses the user, because users consider everything that is still active, and they try to click on it, but it just cancels the search dialog, And it distracts the user from the search task (these are the search results, they may wonder?).

Question: how to blur (make out of focus) or darken the previous activity? I really see this on some application search screens.

+3
source share
2 answers

I found an easy way to blur the background of the search dialog:

Basically it's just adding a (semi) transparent view to the ListView (or whatever is under the dialog) and hide it by default. If a search dialog box appears (call onSearchRequested ()), then it is set to visible; if it disappears, it returns (invisible).

Check out the details on his blog: http://mavistechchannel.wordpress.com/2011/08/13/blur-background-android-search-dialog/

+2
source

Assuming what you got dialogfrom Dialog.Builder, use the following:

dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
+2
source

All Articles