title: This Activity already has an action bar supplied by the window decor. after updating android studio
body: <p>I tried all solutions from this <a href="https://stackoverflow.com/questions/26515058/this-activity-already-has-an-action-bar-supplied-by-the-window-decor">link</a> but none of them works for me</p>
  
  <pre><code>Process: org.dmfs.tasks, PID: 12137 java.lang.RuntimeException: Unable
  to start activity
  ComponentInfo{org.dmfs.tasks/org.dmfs.tasks.Main.TimerActivity}:
  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.
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
      at android.app.ActivityThread.-wrap11(Unknown Source:0)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
      at android.os.Handler.dispatchMessage(Handler.java:105)
      at android.os.Looper.loop(Looper.java:164)
      at android.app.ActivityThread.main(ActivityThread.java:6541)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)  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.
      at androidx.appcompat.app.AppCompatDelegateImpl.setSupportActionBar(AppCompatDelegateImpl.java:408)
      at androidx.appcompat.app.AppCompatActivity.setSupportActionBar(AppCompatActivity.java:150)
      at org.dmfs.tasks.Main.TimerActivity.onCreate(TimerActivity.java:173)
      at android.app.Activity.performCreate(Activity.java:6975)
      at android.app.callActivityOnCreate(Instrumentation.java:1213)
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) 
      at android.app.ActivityThread.-wrap11(Unknown Source:0) 
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) 
      at android.os.Handler.dispatchMessage(Handler.java:105) 
      at android.os.Looper.loop(Looper.java:164) 
      at android.app.ActivityThread.main(ActivityThread.java:6541) 
      at java.lang.reflect.Method.invoke(Native Method) 
      at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
  </code></pre>
  
  <p>my theme in styles.xml:</p>
  
  <pre><code>&lt;style name="AppTheme" parent="Theme.MaterialComponents.NoActionBar"&gt;
          &lt;item name="colorPrimary"&gt;@color/white&lt;/item&gt;
          &lt;item name="colorPrimaryVariant"&gt;@color/white&lt;/item&gt;
          &lt;item name="colorOnPrimary"&gt;#000&lt;/item&gt;
          &lt;item name="colorSecondary"&gt;@color/teal200&lt;/item&gt;
          &lt;item name="colorSecondaryVariant"&gt;@color/teal300&lt;/item&gt;
          &lt;item name="colorOnSecondary"&gt;@color/white&lt;/item&gt;
  
          &lt;item name="android:colorBackground"&gt;@color/gray1000&lt;/item&gt;
          &lt;item name="colorOnBackground"&gt;@color/white&lt;/item&gt;
          &lt;item name="colorSurface"&gt;@color/black&lt;/item&gt;
          &lt;item name="colorOnSurface"&gt;@color/white&lt;/item&gt;
  
          &lt;item name="colorPrimaryDark"&gt;@color/white&lt;/item&gt;
          &lt;item name="android:windowBackground"&gt;@color/black&lt;/item&gt;
          &lt;item name="android:textColorPrimary"&gt;@android:color/black&lt;/item&gt;
  
          &lt;item name="appBarColor"&gt;@color/black&lt;/item&gt;
          &lt;item name="cardViewColor"&gt;@color/black&lt;/item&gt;
          &lt;item name="alertDialogColor"&gt;@color/gray1000&lt;/item&gt;
  
          &lt;item name="viewInflaterClass"&gt;androidx.appcompat.app.AppCompatViewInflater&lt;/item&gt;
          &lt;item name="windowActionModeOverlay"&gt;true&lt;/item&gt;
          &lt;item name="android:actionModeCloseDrawable"&gt;@drawable/ic_clear&lt;/item&gt;
          &lt;item name="actionModeStyle"&gt;@style/ActionModeStyle&lt;/item&gt;
  
          &lt;item name="alertDialogTheme"&gt;@style/DialogTheme&lt;/item&gt;
  
          &lt;item name="palette"&gt;@array/lightPalette&lt;/item&gt;
          &lt;item name="fontFamily"&gt;@font/app_font&lt;/item&gt;
          &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
          &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
      &lt;/style&gt;
  </code></pre>
  
  <p>theme Activity in my manifest:</p>
  
  <pre><code>  &lt;activity
              android:name="org.dmfs.tasks.Main.TimerActivity"
              android:showOnLockScreen="true"
              android:launchMode="singleTask"
              android:theme="@style/AppTheme"&gt;
  </code></pre>
  
  <p>Code from the Activity:</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      EventBus.getDefault().register(this);
  
      }
  
      ThemeHelper.setTheme(this);
      ActivityMain3Binding binding = DataBindingUtil.setContentView(this, R.layout.activity_main3);
  
      mBlackCover = binding.blackCover;
      mToolbar = binding.bar;
      mTimeLabel = binding.timeLabel;
      mTutorialDot = binding.tutorialDot;
      mBoundsView = binding.main;
  
      mViewModel = ViewModelProviders.of(this).get(TimerActivityViewModel.class);
  
      setupTimeLabelEvents();
  
      setSupportActionBar(mToolbar);
      if (getSupportActionBar() != null) {
          getSupportActionBar().setTitle(null);
      }
  </code></pre>
  
  <p>the error produces by this line : setSupportActionBar(mToolbar);
  i want to use a toolbar from activity_main with the ID "bar" instead of the default action bar.How can i solve this?</p>
  
  <p>note: I didn't have this error, it was produced suddenly when I updated android studio canary to 3.6</p>