title: Android: IllegalStateException is thrown while calling AppCompatActivity
body: <p>As stated in the title, my application quits showing an IllegalStateException. I'm learning the Android programming, so your kind help will be very much helpful.</p>
  
  <p>According to the LogCat, the exception is caught at the onCreate method at MainActivity.java as follows.</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
      private SQLiteHandler db;
      private SessionManager session;
      private boolean backPressedOnce = false;
      private FragmentManager manager;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          manager = getFragmentManager();
          FragmentTransaction transaction = manager.beginTransaction();
          MainActivityFragment fragment = new MainActivityFragment();
          transaction.replace(R.id.fragment, fragment);
          transaction.addToBackStack(null);
          transaction.commit();
  
          db = new SQLiteHandler(getApplicationContext());
          session = new SessionManager(getApplicationContext());
          if(!session.isLoggedIn()) {
              logout();
          }
      }
  </code></pre>
  
  <p>the setContentView method seems to have a problem, so let me further post the other parts of the code.</p>
  
  <p>I think this problem is based on the theme, so I would like to ask your opinions with Androidmanifest.xml file.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.marshall.politicalcompass" &gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" /&gt;
  
      &lt;application
          android:name="com.marshall.politicalcompass.app.AppController"
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:theme="@android:style/Theme.Holo.Light.DarkActionBar" &gt;
          &lt;activity
              android:name=".SplashActivity"
              android:noHistory="true" &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;
  
          &lt;activity android:name=".InitialActivity" /&gt;
          &lt;activity android:name=".LoginActivity" android:noHistory="true"/&gt;
          &lt;activity android:name=".RegisterActivity" /&gt;
          &lt;activity android:name=".MainActivity" android:launchMode="singleTop"/&gt;
          &lt;activity android:name=".TestActivity"
              android:label="@string/title_test"
              android:parentActivityName=".MainActivity"
              android:uiOptions="splitActionBarWhenNarrow" &gt;
          &lt;meta-data android:name="android.support.PARENT_ACTIVITY"
              android:value=".MainActivity" /&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>And finally here's the error log.</p>
  
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.marshall.politicalcompass/com.marshall.politicalcompass.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2413)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
              at android.app.ActivityThread.access$900(ActivityThread.java:175)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:146)
              at android.app.ActivityThread.main(ActivityThread.java:5602)
              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:1283)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
              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:309)
              at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:278)
              at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:252)
              at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
              at com.marshall.politicalcompass.MainActivity.onCreate(MainActivity.java:25)
              at android.app.Activity.performCreate(Activity.java:5451)
              at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2377)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
              at android.app.ActivityThread.access$900(ActivityThread.java:175)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:146)
              at android.app.ActivityThread.main(ActivityThread.java:5602)
              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:1283)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
              at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>If you need further information, please let me know.</p>