title: setSupportActionBar with AppCompat
body: <p>I was following a tutorial on how to get a Toolbar instead of a Actionbar. </p>
  
  <p>This tutorial said that I had to extend mainActivity to ActionbarActivity but this class is deprecated. I google'd some and found out to use AppCompatActivity instead. </p>
  
  <p>Now I'm getting the error actionbar is already provided by the mainactivity</p>
  
  <p>My theme is set to custom theme with both parents <code>.NoActionBar</code>.</p>
  
  <p>The error is in the onCreate method of the mainActivity when I try to setSupportActionBar(toolbar element)</p>
  
  <p>Styles:</p>
  
  <pre><code>&lt;resources&gt;
  &lt;!-- Base application theme. --&gt;
      &lt;style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"&gt;
          &lt;item name="android:colorPrimary"&gt;@color/ColorPrimary&lt;/item&gt;
          &lt;item name="android:colorPrimaryDark"&gt;@color/ColorPrimaryDark&lt;/item&gt;
  
  &lt;/style&gt;
  </code></pre>
  
  <p></p>
  
  <p>Styles v21:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
      &lt;style name="AppTheme" parent="android:Theme.Material.Light.NoActionBar"&gt;
          &lt;item name="android:windowActionBar"&gt;false&lt;/item&gt;
          &lt;item name="android:colorPrimary"&gt;@color/ColorPrimary&lt;/item&gt;
          &lt;item name="android:colorPrimaryDark"&gt;@color/ColorPrimaryDark&lt;/item&gt;
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>Manifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/Theme.AppCompat" &gt;
      &lt;activity
          android:name=".MainActivity"
          android:label="@string/app_name" &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;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>Mainactivity.xml</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context=".MainActivity"&gt;
  
  &lt;include android:id="@+id/tool_bar"
      layout="@layout/tool_bar"
      /&gt;
  
  &lt;TextView
      android:layout_below="@+id/tool_bar"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginTop="5dp"
      android:text="@string/hello_world" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>Mainactivity class:</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      private Toolbar toolbar;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          toolbar = (Toolbar) findViewById(R.id.tool_bar); // Attaching the layout to the toolbar object
          setSupportActionBar(toolbar);
          // Setting toolbar as the ActionBar with setSupportActionBar() call
  
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_main, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
  
          //noinspection SimplifiableIfStatement
          if (id == R.id.action_settings) {
              return true;
          }
  
          return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>
  
  <p>How can I fix this?</p>