This Activity already has an action bar supplied by the window decor
I think you're developing for Android Lollipop, but anyway include this line:
<item name="windowActionBar">false</item>
to your theme declaration inside of your app/src/main/res/values/styles.xml
.
Also, if you're using AppCompatActivity
support library of version 22.1 or greater, add this line:
<item name="windowNoTitle">true</item>
Your theme declaration may look like this after all these additions:
<!-- Base application theme. --><style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item></style>
Another easy way is to make your theme a child of Theme.AppCompat.Light.NoActionBar
like so:
<style name="NoActionBarTheme" parent="Theme.AppCompat.Light.NoActionBar"> ...</style>
Add single line android:theme="@style/AppTheme.NoActionBar"
to activity
in AndroidManifest
and you've done.
AndroidManifest.xml:
<activity android:name=".activity.YourActivity" android:theme="@style/AppTheme.NoActionBar"><!-- ADD THIS LINE -->
styles.xml
<style name="AppTheme.NoActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item></style>