Mark F
Mark F

Reputation: 1543

Action Bar in Android Studio 1.5 Upgrade

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:

enter image description here

I don't want to use this Toolbar so I delete it. Now the activity_main.xml file looks like this:

enter image description here

I still want to have an actionBar however. My manifest file, clearly references a theme in my styles folder: enter image description here

And here is is the styles.xml file, which sets a theme for the Action Barenter image description here:

How come, when I start the emulator, my action bar is missing? My main_activity extends AppCompatActivity. Any idea why this is happening? enter image description here

Upvotes: 0

Views: 654

Answers (1)

Blackbelt
Blackbelt

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

Related Questions