...">

Transparent activity view at 2.3

I used this xml style:

<style name="Theme.Transparent" parent="@android:style/Theme.Translucent.NoTitleBar">       

This showed a transparent full-screen layout, with no title or status bar on top in Android 2.1 and 2.2. However, when I tested the application on 2.3, the same activity showed the top line of the screen status (battery, etc.).

I had to inject these lines into my onCreate java code:

requestWindowFeature(Window.FEATURE_NO_TITLE);     
 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 

To remove it from the top or top row.

Can anyone shed some light on why this difference is between 2.2 and 2.3?

+5
source share
2 answers

You can customize the theme as follows:

<style name="Theme.Transparent" parent="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">"

And this should hide both the title and the full-screen mode in each version.

+5
source

You can also use this.

 <application android:icon="@drawable/icon" android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
+1
source

All Articles