0

I want remove title bar from my application but when I use Theme.Light.NoTitleBar it shows errors in styles xml file this is my styles xml file

<!--
    Base application theme, dependent on API level. This theme is replaced
    by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
    <!--
        Theme customizations available in newer API levels can go in
        res/values-vXX/styles.xml, while customizations related to
        backward-compatibility can go here.
    -->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
</resources>

and this is my manifest file

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" > 
  • 3
    possible duplicate of [Android: how to hide ActionBar on certain activities](http://stackoverflow.com/questions/19545370/android-how-to-hide-actionbar-on-certain-activities) – Shabbir Dhangot Nov 19 '14 at 04:32

5 Answers5

0

First way it use all Activity

requestWindowFeature(Window.FEATURE_NO_TITLE);

On the toolbar directly below the tab bar, there is a row of icons. Click on the one that looks like a star, then go to All -> Theme.NoTitleBar(.Fullscreen)

enter image description here

Source

Community
  • 1
  • 1
Naveen Tamrakar
  • 3,349
  • 1
  • 19
  • 28
0

Try this:

 <style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
      <item name="android:windowNoTitle">true</item>
 </style>
Avetard
  • 23
  • 5
0

Try this

this.requestWindowFeature(Window.FEATURE_NO_TITLE); // Remove title bar
setContentView(R.layout.activity_home);

Note : Features like removing the Title Bar , Notification Bar must be called before setContentView(layout_id);

Don Chakkappan
  • 7,397
  • 5
  • 44
  • 59
0

programmatically

this.requestWindowFeature(Window.FEATURE_NO_TITLE); 
setContentView(R.layout.activity_home);

From Manifest File

<activity
        android:name="<YOUR_PACKAGENAME.ACTIVITY>"
        android:theme="@android:style/Theme.Black.NoTitleBar" >

and you are done :)

Jeffy Lazar
  • 1,903
  • 13
  • 20
0
//add to AndroidManifest for SplashScreen
<activity
         android:name="<YOUR_PACKAGENAME.ACTIVITY>"
         android:theme="@style/AppTheme.NoActionBar"
         .........../>
//add this styles to  styles.xml

 <style name="AppTheme.NoActionBar">
    <item name="android:background">@android:color/transparent</item>
    <item name="android:windowDisablePreview">true</item>
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowBackground">@null</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

//add this code to Activity
public class SplashScreen extends AppCompatActivity {
.
.
    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    .
    .
    .
    }

}
sirmagid
  • 1,090
  • 1
  • 16
  • 23