-1

How to get one single ACTIVITY without Title?

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

This code is in styles.xml ! when i am using "NoActionBar" then all activity show no title bar,

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
symi khan
  • 465
  • 5
  • 9

2 Answers2

0

Apply the theme without an ActionBar only for the specific Activity that requires it. It has to be set in the manifest.xml in the Activity tag: android:theme="@style/<YourAppThemeWithoutActionbarHere>"

Rene Ferrari
  • 4,096
  • 3
  • 22
  • 28
0

You can define one another style into your styles.xml , where you can use NoActionBar in Theme.

<style name="AppThemeWithoutActionBar" 
    parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

and then go to your project's Manifest file , and then you can apply this new style (without an ActionBar) only for the specific Activity that requires it.

<activity 
     android:name=".YourActivityWhereYouDoNotWantToolbar"
     android:theme="@style/AppThemeWithoutActionBar">

It will solve your problem.

Sachin Rajput
  • 4,326
  • 2
  • 18
  • 29