I am having this style:
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
</style>
<!-- Application theme. -->
<style name="MyAppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
Of course, in the manifest I have:
<application
android:name=".MyAppApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/MyAppTheme" >
I am trying to implement material design toolbar following this article: www.android4devs.com/2015/01/how-to-make-material-design-sliding-tabs.html#
Now, if I'm leaving everything as above, I get:
java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.
But if I'm changing my style to this:
<!-- Application theme. -->
<style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
i.e., the parent is directly Theme.AppCompat.Light.NoActionBar
then everything works without the error message.
Can anyone see what am I missing? why is that so?