18

I developed an application. I would like to remove space that is used for showing application name on top of my application UI. (The Title Bar)

I set Application label as null In manifest File But it will not remove the space for showing Application name

Please tell me what is the correct or possible way to do that

Thanks in advance

st0le
  • 33,375
  • 8
  • 89
  • 89
Dev.Sinto
  • 6,802
  • 8
  • 36
  • 54
  • 1
    possible duplicate of [How disable / remove android activity label and label bar?](http://stackoverflow.com/questions/4388068/how-disable-remove-android-activity-label-and-label-bar) – Octavian Helm Dec 09 '10 at 09:45
  • Thanks Buddy for the quick replay cheers,Kariyachan – Dev.Sinto Dec 09 '10 at 09:59

4 Answers4

33

You request window feature in your onCreate method:

@Override
public void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_NO_TITLE);       
    super.onCreate(savedInstanceState);
}

or in AndroidManifest.xml:

<activity android:name=".YourClassName"
   android:theme="@android:style/Theme.NoTitleBar">
</activity>
Ajinkya
  • 22,324
  • 33
  • 110
  • 161
danizmax
  • 2,446
  • 2
  • 32
  • 41
  • 4
    I'd just wanted to add that `requestWindowFeature` should be called before `setContentView`... – st0le Dec 09 '10 at 10:06
  • java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. – PeerNet Aug 21 '17 at 07:16
6

i think you can add this line in you application tag in android manifest file

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

Sunit Kumar Gupta
  • 1,203
  • 1
  • 11
  • 19
5

For android studio:

In android AndroidManifest.xml file change the theme like: android:theme="@style/Theme.AppCompat.Light.NoActionBar"

example

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/Theme.AppCompat.Light.NoActionBar" >
Vamkos
  • 125
  • 1
  • 8
0

you can use this style

<style name="MyTheme" parent="@android:style/Theme.NoTitleBar">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowBackground">@drawable/xyz</item>
</style>
Hossein
  • 314
  • 3
  • 12