title: java illegalstateexception android.support.v7.app.AppCompatDelegateImplV7.createSubDecor
body: <p>I had my app in production which had support from API 8+ to 23. I recently updated the app to have material design which used navigation drawer. This version had support from 14+ to 23. </p>
  
  <p>The app is working fine on API 21 [ lollipop ] and above, however, there are crash reports for 4.4 "java illegalstateexception android.support.v7.app.AppCompatDelegateImplV7.createSubDecor"</p>
  
  <p>My style.xml is</p>
  
  <pre><code>&lt;!-- Base application theme. --&gt;
  &lt;style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"&gt;
      &lt;!-- Customize your theme here. --&gt;
      &lt;!-- Customize your theme here. --&gt;
      &lt;item name="colorPrimary"&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name="colorPrimaryDark"&gt;@color/colorPrimaryDark&lt;/item&gt;
      &lt;item name="colorAccent"&gt;@color/colorAccent&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /&gt;
  
  &lt;style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>My style.xml-v21 is</p>
  
  <p>></p>
  
  <pre><code>&lt;style name="AppTheme.NoActionBar"&gt;
      &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
      &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
      &lt;item name="android:windowDrawsSystemBarBackgrounds"&gt;true&lt;/item&gt;
      &lt;item name="android:statusBarColor"&gt;@android:color/transparent&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p></p>
  
  <p>The manifest file is</p>
  
  <pre><code>&lt;application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:supportsRtl="true"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name=".View.MainActivity"
          android:label="@string/app_name"
          android:theme="@style/Theme.AppCompat.NoActionBar"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  </code></pre>
  
  <p>The mainactivity extends,</p>
  
  <p>public class MainActivity extends AppCompatActivity  implements        NavigationView.OnNavigationItemSelectedListener {</p>
  
  <p>The log cat error is below</p>
  
  <p>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.XYZ/com.XYZ.View.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2200)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2249)
      at android.app.ActivityThread.access$800(ActivityThread.java:141)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1212)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:136)
      at android.app.ActivityThread.main(ActivityThread.java:5113)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:515)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
      at dalvik.system.NativeStart.main(Native Method)
  Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
      at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:310)
      at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:279)
      at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:253)
      at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
      at com.XYZ.View.MainActivity.onCreate(MainActivity.java:62)
      at android.app.Activity.performCreate(Activity.java:5248)
      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2164)
      ... 11 more</p>
  
  <p>Any help on how to handle this error would be much appreciated. I have already looked around the similar issue cases listed here but could not get this fixed. </p>
  
  <ol>
  <li><p>Is it possible to have Navigation drawer in API less than 21?</p></li>
  <li><p>What changes should be made in style.xml to support backward compatibility?</p></li>
  <li><p>I tried android:theme="@style/Theme.AppCompat.NoActionBar"> in MainActivity, result was in API 21 Navigation drawer worked properly expect for rendering usual theme color. In API 19, the app worked without crashing but the navigation bar went off totally which would mean only the main activity was visible to user.</p></li>
  </ol>
  
  <p>Thanks for your time in advance.</p>