title: How to change the color theme of android app?
body: <p>I’ve been following instructions on how to change the <a href="https://stackoverflow.com/questions/8024706/how-do-i-change-the-background-color-of-the-actionbar-of-an-actionbaractivity-us">color</a>, but the program produces this error: </p>
  
  <p>06-29 19:20:39.416 7041-7041/com.example.lucerne.adapter_example_2 E/AndroidRuntime: FATAL EXCEPTION: main</p>
  
  <pre><code>    Process: com.example.lucerne.adapter_example_2, PID: 7041
  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.lucerne.adapter_example_2/com.example.lucerne.adapter_example_2.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
  </code></pre>
  
  <p>Currently, style.xml looks like below: </p>
  
  <p></p>
  
  <pre><code>&lt;!--&lt;color name="white_opaque"&gt;#FFFFFFFF&lt;/color&gt;--&gt;
  &lt;!--&lt;color name="pitch_black"&gt;#FF000000&lt;/color&gt;--&gt;
  
  &lt;!--&lt;style name="AppTheme" parent="android:Theme.Light"&gt;--&gt;
      &lt;!--&lt;item name="android:background"&gt;@color/white_opaque&lt;/item&gt;--&gt;
      &lt;!--&lt;item name="android:windowBackground"&gt;@color/white_opaque&lt;/item&gt;--&gt;
      &lt;!--&lt;item name="android:colorBackground"&gt;@color/white_opaque&lt;/item&gt;--&gt;
  
  &lt;!--&lt;/style&gt;--&gt;
  
   &lt;!--Base application theme. --&gt;
  &lt;style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"&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;!--&lt;style name="AppTheme" parent="@android:style/Theme.Holo.Light"&gt;--&gt;
      &lt;!--&lt;item name="android:actionBarStyle"&gt;@style/MyActionBarTheme&lt;/item&gt;--&gt;
  &lt;!--&lt;/style&gt;--&gt;
  &lt;!--&lt;style name="MyActionBarTheme" parent="@android:style/Widget.Holo.Light.ActionBar"&gt;--&gt;
      &lt;!--&lt;item name="android:background"&gt;#FF0000&lt;/item&gt;--&gt;
  &lt;!--&lt;/style&gt;--&gt;
  </code></pre>
  
  <p></p>
  
  <p>What is causing the error, and how I can change the colors to something else? </p>
  
  <p><a href="https://i.stack.imgur.com/l25aw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l25aw.png" alt="enter image description here"></a></p>