The Actionbar has been deprecated and replaced by Toolbar. That being said, you can do the following if you want to continue using Actionbar for now:
I had the same issue today and this solution worked for me. FYI I am in Android Studio though, but hopefully,the solution is similar for Eclipse.
FYI here is a decent blog post on replacing the Actionbar with the Toolbar for when you are ready to do so: https://blog.xamarin.com/android-tips-hello-toolbar-goodbye-action-bar/
I think you must be depending on "com.android.support:appcompat-v7:23.1.1"
in your module
settings.
ActionBar
has been deprecated.
Just change your dependencies from 'com.android.support:appcompat-v7:23.1.1'
to 'com.android.support:appcompat-v7:23.0.1'
in "build.gradle".
You can also change your style parent to "Theme.AppCompat.Light.NoActionBar"
.
Try to use the Toolbar
instead of ActionBar
.
This one works for me
Changing AppTheme parent in res/values/styles.xml resolved this problem. Replace
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
with
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
Or you can change API level 21 from list.
goto: res-->values-->styles(V21)-->
Code
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
select your theme as Apptheme.NoActionBar
in preview. Because ActionBar
is depricated, welcome back to ToolBar
. NO need to change your dependencies in build.gradle(Module:app)
.
from com.android.support:appcompat-v7:23.1.1
to com.android.support:appcompat-v7:23.0.1
.
Hope this will help you!!!
I had a similar issue, and as many have said since ActionBar has been deprecated the trick was to specify
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
NOTE: that the parent ends in .NoActionBar.
Since ActionBar has been deprecated Android has gone into using ToolBar which you can read about here on the developer.android.com
I tried specifying
<style name="AppTheme.NoActionBar">
As a another post stated and that threw errors. Though others may not have that issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With