PreferenceActivity with blur behind?

by Ralf » Mon, 22 Dec 2008 09:26:05 GMT


Sponsored Links
 I'm trying to use a PreferenceActivity with prefs inflated from XML
and at the same time I'd like the window to blur whatever was behind
(i.e. my previous activity where I invoked the settings from.) I tried
something like this below but the background is always black (or
whatever color I select) without any blur/transparency.

Is it possible? what am I doing wrong?

public class PrefsActivity extends PreferenceActivity {

    @Override
        protected void onCreate(Bundle savedInstanceState) {
        // Have the system blur any windows behind this one.
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
                WindowManager.LayoutParams.FLAG_BLUR_BEHIND);

                super.onCreate(savedInstanceState);
                
                setTitle(R.string.prefs_title);
                addPreferencesFromResource(R.xml.prefs);

            View content = findViewById(android.R.id.content);
            content.setBackgroundColor(0x7F000000);
        
            getListView().setBackgroundColor(0x7F000000);
            getListView().setCacheColorHint(0x7F000000);
        }
}

R/

--~--~---------~--~----~------------~-------~--~----~



PreferenceActivity with blur behind?

by Colin » Thu, 12 Feb 2009 03:02:58 GMT


 Im also interested in learning how to do this... any ideas?




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


PreferenceActivity with blur behind?

by Rohit » Sat, 07 Mar 2009 05:20:26 GMT


 Make sure that the activity you are calling has the theme attribute
set to Theme.Dialog in the Android Manifest as follows:

android:theme="@android:style/Theme.Dialog"

Rohit





--~--~---------~--~----~------------~-------~--~----~



PreferenceActivity with blur behind?

by Dianne Hackborn » Sat, 07 Mar 2009 05:25:38 GMT


 Or Theme.Translucent.

There is an API demo showing how to do this with an activity in general,
which should be no different than a preference activity.








-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. About Xmpp settings

Hi,


   I gave correct username and password.But it display it is not a valid
username or password.

   Can anybody please tell me,What is the solution for the error?


Thanks
judy

--~--~---------~--~----~------------~-------~--~----~

2. Problem with returning result from activity

Are you using android:launchMode="singleTask" or "singleInstance"?



--~--~---------~--~----~------------~-------~--~----~

3. question about android library

4. GSolitaire is released

5. SDK - JavaDoc or Source Code

6. Android browser?

7. TextView onClickListener does not work?