title: This Activity already has an action bar supplied by the window decor?
body: <p>I am making an <code>Android</code> app using <code>Toolbar</code> with <code>Custom style</code> but when i'm running the app, i'm getting the following error:</p>
  
  <blockquote>
    <p>Caused by: java.lang.IllegalStateException: This Activity already has
    an action bar supplied by the window decor. Do not request
    Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in
    your theme to use a Toolbar instead.</p>
  </blockquote>
  
  <p><strong>Styles.xml</strong></p>
  
  <pre><code>&lt;resources&gt;
  
  &lt;!-- Base application theme. --&gt;
  &lt;style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"&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/colorPrimary&lt;/item&gt;
      &lt;item name="android:textColor"&gt;@color/textColorPrimary&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name="AppTheme.NoActionBar"&gt;
      &lt;item name="android:textColorSecondary"&gt;@color/textColorPrimary&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;
  
  &lt;style name="MyMaterialTheme" parent="Theme.AppCompat.Light.NoActionBar"&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/colorPrimary&lt;/item&gt;
  
  &lt;/style&gt;
  
  
  &lt;style name="MyEditTextTheme" parent="Theme.AppCompat.Light.NoActionBar"&gt;
      &lt;!-- Used for the bottom line when not selected / focused --&gt;
      &lt;item name="colorAccent"&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name="android:textColor"&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name="android:colorBackground"&gt;@color/colorBackground&lt;/item&gt;
      &lt;item name="android:textStyle"&gt;bold&lt;/item&gt;
      &lt;item name="android:endColor"&gt;@color/colorPrimary&lt;/item&gt;
  
  
  
  
      &lt;!-- colorControlActivated &amp; colorControlHighlight use the colorAccent color by default --&gt;
  &lt;/style&gt;
  
  &lt;style name="TabTextAppearance" parent="Theme.AppCompat.Light.DarkActionBar"&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/colorPrimary&lt;/item&gt;
      &lt;item name="android:colorBackground"&gt;@color/colorBackground&lt;/item&gt;
      &lt;item name="android:textAllCaps"&gt;false&lt;/item&gt;
      &lt;item name="android:textStyle"&gt;bold&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>MainActivity:</strong></p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
  private TabLayout tabLayout;
  private ViewPager viewPager;
  
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.content_information_category1);
      Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar_information);
      setSupportActionBar(toolbar);
  
      viewPager = (ViewPager) findViewById(R.id.viewpager);
      setupViewPager(viewPager);
  
      tabLayout = (TabLayout) findViewById(R.id.tabs);
      tabLayout.setupWithViewPager(viewPager);
  
  
  }
  
  private void setupViewPager(ViewPager viewPager) {
      ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
      adapter.addFragment(new TodayInformationFragment(), "Today");
      adapter.addFragment(new ThisWeekInformationFragment(), "This Week");
      adapter.addFragment(new ThisMonthInformationFragment(), "This Month");
      adapter.addFragment(new AllyearInformationFragment(), "All");
      viewPager.setAdapter(adapter);
  }
  class ViewPagerAdapter extends FragmentPagerAdapter {
      private final List&lt;Fragment&gt; mFragmentList = new ArrayList&lt;&gt;();
      private final List&lt;String&gt; mFragmentTitleList = new ArrayList&lt;&gt;();
  
      public ViewPagerAdapter(FragmentManager manager) {
          super(manager);
      }
  
      @Override
      public Fragment getItem(int position) {
          return mFragmentList.get(position);
      }
  
      @Override
      public int getCount() {
          return mFragmentList.size();
      }
  
      public void addFragment(Fragment fragment, String title) {
          mFragmentList.add(fragment);
          mFragmentTitleList.add(title);
      }
  
      @Override
      public CharSequence getPageTitle(int position) {
          return mFragmentTitleList.get(position);
      }
  }
  </code></pre>
  
  <p>}</p>