Full screen transparent activity (no title & status bar) doesn't work.... why?

dor506 picture dor506 · Dec 24, 2011 · Viewed 35.8k times · Source

I'm making a custom lock screen.

The lock screen is an activity which I launch by the time the screen goes off.

However, I can't make the activity be both transparent & fullscreen.

The Status bar keeps showing.

Here's what I do in the manifest:

<activity android:name=".activities.LockScreenActivity"  android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>

I'm also adding these extras in activit's onCreate:

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.lock_screen);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);

But it can't seem to work :|

why?

Answer

RajaReddy PolamReddy picture RajaReddy PolamReddy · Dec 24, 2011

delete the code from onCreate(). use this in Manifestfile.

android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"

otherwise create the theme according to your requirement.