Lumis
Lumis

Reputation: 21639

transparent activity's full screen on 2.3

I was using this xml style:

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

This was showing a tansparent layout with full screen, no title bar or status bar on the top in android 2.1 and 2.2. However, when I tested the application on 2.3, the same activity was showing the home screen status bar on the top (battery etc).

I had to enter these lines to my java code onCreate:

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

To get it to remove any status or title bar from the top.

Can anybody shed light why this difference between 2.2 and 2.3?

Upvotes: 5

Views: 2923

Answers (2)

Sher Ali
Sher Ali

Reputation: 5793

You Can Also Use This

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

Upvotes: 1

Joshua Coffey
Joshua Coffey

Reputation: 330

You can set the theme to:

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

And that should hide both the title bar and fullscreen in every version.

Upvotes: 5

Related Questions