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. different layout XML files in one application

Hello,

how to use ( or just is it possible at all ) to use
layout definitions in separate XML files in one application ?

i.e => dynamicly create Views from different XML files as
R.layout.main

Thx,
   -vitali
--~--~---------~--~----~------------~-------~--~----~

2. How to connect to a server that runs on a localhost with the same eclipse program as the emulator?

within the emulator, address 10.0.2.2 is a special alias that connects
directly to your development machine's localhost (i.e. you r own 127.0.0.1)







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

3. Customize look of Menus

4. Expanded and Icon Menu styling

5. TimePicker in a dialog?

6. How to make rows smaller in ListView?

7. CursorTreeAdapter ?