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. Nokia inviting Developers to become an Ovi store publisher.

I'm a developer and just received an email from Forum Nokia regarding
Unmatched distribution opportunities at Ovi store at NOKIA.

If u are a developer nd dream it big then grab this opportunity today.
Nokia inviting developers to Become an Ovi store publisher.

      Easy access to reach millions of consumers worldwide
      Fast time to market with self serve publishing
      Monetize your apps and content with Nokia- provided billing
      Daily time sales and usage reports
[B]Unmatched distribution opportunities at Ovi store at NOKIA. [/B]

To Discover How Nokia can make you Instapreneur check this:http://
www.oviinstapreneurs.com/

Be the next big Mobile Enterpreneur Instantly with the help of Nokia
Ovi store

-- 

2. Force close/wait popup while in onCreate().

Hi.


My situation:
I've a lot of  initialization code in my main activity's onCreate().
When I launch my game, the screen goes black for a long time, then my
game appears.
I did logged some message at the start and end of onCreate() and found
that onCreate() is executing its code while the screen is black.


OK, here's the problem:
Sometimes the screen goes black for too long and phone shows a popup
dialog prompting me to choose between Force close/Wait.  Then when
onCreate() is completed, my game appears. Choosing 'Wait' then dismiss
the dialog.


How to solve this?
I tried using progress dialog described in this article
http://developer.android.com/guide/topics/ui/dialogs.html#ProgressDialog

But it doesn't work. The screen goes black for the same amount of time
even after I use the progress dialog.

Thank you in advance!

-- 

3. telechips tcc89/91/92xx porting

4. Unlocked Nexus One, cannot install updates

5. Adding Contacts in Custom account 2.2

6. Automatic testing tool for Android?

7. How to access contact and account database