Reputation: 1543
Can someone explain what is happening here. I load a blank Activity and two xml files are created in Android Studio; the content_main.xml, which contains all of my widgets, and activity_main.xml, which includes my contents file and looks like this:
I don't want to use this Toolbar so I delete it. Now the activity_main.xml file looks like this:
I still want to have an actionBar however. My manifest file, clearly references a theme in my styles folder:
And here is is the styles.xml file, which sets a theme for the Action Bar:
How come, when I start the emulator, my action bar is missing? My main_activity extends AppCompatActivity. Any idea why this is happening?
Upvotes: 0
Views: 654
Reputation: 157447
you are activity is overriding the Application
's theme and using the NoActionBar
theme. Get rid of android:theme
from the <activity
tag
Change from
<activity
android:theme="@style/AppTheme.NoActionBar"
android:name=".MainActivity"
android:label="@string/app_name">
to
<activity
android:name=".MainActivity"
android:label="@string/app_name">
Upvotes: 2