---
title: "hide the title bar for an Activity in XML with existing custom theme"  
description: "hide the title bar for an Activity in XML with existing custom theme"  
author: "Anonymous User"  
published: 2015-06-04  
updated: 2015-06-04  
canonical: https://www.mindstick.com/forum/23282/hide-the-title-bar-for-an-activity-in-xml-with-existing-custom-theme  
category: "android"  
tags: ["android", "android styles"]  
reading_time: 2 minutes  

---

# hide the title bar for an Activity in XML with existing custom theme

I want to hide the [titlebar](https://www.mindstick.com/forum/1013/how-to-change-font-color-and-size-of-titlebar-in-sencha-touch) for some of my [activities](https://www.mindstick.com/interview/2589/describe-android-activities-in-brief). The [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) is that I applied a [style](https://www.mindstick.com/articles/126300/apa-citation-style-get-to-know-about-it-for-your-next-assignment) to all my activities, therefore I can't simply set the theme to @[android](https://www.mindstick.com/articles/13046/10-reasons-why-i-prefer-android-vs-iphone-ios):style/Theme.NoTitleBar.

Using the NoTitleBar theme as a [parent](https://www.mindstick.com/blog/154/how-to-find-parent-of-control-in-wpf) for my style would [remove](https://yourviews.mindstick.com/story/4554/8-harmful-weeds-to-remove-from-garden) the [title](https://www.mindstick.com/articles/12860/how-to-get-financing-for-salvage-title-cars) bar for to much activities.

Can I set a no title style [item](https://www.mindstick.com/forum/156564/remove-item-in-an-array-in-javascript) somewhere?

## Replies

### Reply by Anonymous User

Do this in your onCreate() method.\

```
//Remove title barthis.requestWindowFeature(Window.FEATURE_NO_TITLE);//Remove notification barthis.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//set content view AFTER ABOVE sequence (to avoid crash)this.setContentView(R.layout.your_layout_name_here); 
```

\
**this** refers to the Activity.\
**Also**,you can declared a style inheriting everything from my general style and then disabling the titleBar.\

```
<style name="generalnotitle" parent="general">    <item name="android:windowNoTitle">true</item></style>
```

Now you can set this style to every Activity in which you want to hide the title bar overwriting the application wide style and inheriting all the other style informations, therefor no duplication in the style code.\
**And**,You can modify your AndroidManifest.xml:\

```
<activity android:name=".MainActivity"          android:label="@string/app_name"          android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
```

You can use this for each activity in your project\
The title bar can be removed in two ways as mentioned on the developer Android page:\
In the manifest.xml file:\
Add the following in application if you want to remove it for all the activities in an app:\

```
<application android:theme="@android:style/Theme.Black.NoTitleBar">
```

Or for a particular activity:\

```
<activity android:theme="@android:style/Theme.Black.NoTitleBar">
```


---

Original Source: https://www.mindstick.com/forum/23282/hide-the-title-bar-for-an-activity-in-xml-with-existing-custom-theme

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
