1

My Project involves use of navigation drawer and Dialog Box. I am using toolbar instead of ActionBar. It was working fine on API Level 16. I am migrating it to API Level 21. But it is showing the following exception: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity

I am using AppCompatActivity in my .java files. Here is my manifest File:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.ojasjuneja.practical6" >

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".SimpleActivity"
            android:label="AnotherActivity" >
        </activity>
    </application>

</manifest>

My Style.xml:

 <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
    </style>

Any Idea why this error is coming?

ojas
  • 2,150
  • 5
  • 22
  • 37

0 Answers0