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>
This Activity already has an action bar supplied by the window decor.
The error specify that your activity does not support Window.FEATURE_SUPPORT_ACTION_BAR
so you can use a toolbar
in your activity layout instead.
Here is Good Example for that.
Additionally you need to set your activity
theme properly in Manifest.
Use:
<activity
android:name=".activity.YourActivity" //the activity where you got the crash
android:theme="@style/AppTheme.NoActionBar"> //add this
This Activity has an action bar supplied by the window decor
Edit your style XML and override or replace "Theme.AppCompat.Light.NoActionbar"
In place of what you are currently using.
Related Topics
How to Prevent a Dialog from Closing When a Button Is Clicked
Difference Between Getcontext() , Getapplicationcontext() , Getbasecontext() and "This"
Java.Lang.Outofmemoryerror: Bitmap Size Exceeds Vm Budget - Android
Determine If the Device Is a Smartphone or Tablet
Integrating the Zxing Library Directly into My Android Application
Do Fragments Really Need an Empty Constructor
How to Change Progress Bar'S Progress Color in Android
"Protected Apps" Setting on Huawei Phones, and How to Handle It
How to Use the Animation Framework Inside the Canvas
Get/Pick an Image from Android'S Built-In Gallery App Programmatically
Comparison of Android Networking Libraries: Okhttp, Retrofit, and Volley
Android: How to Get String from Resources Using Its Name
How to Update Gradle in Android Studio
Scrollview Vertical and Horizontal in Android