title: How to get the Status Bar background color to show colorPrimaryDark
body: <p>I have a layout that used to update the background color of the status bar based on <code>colorPrimaryDark</code>. </p>
  
  <p>This worked great when the layout's root layout was a <code>CoordinatorLayout</code>, but when I switched it to a <code>LinearLayout</code> the status bar background is no longer updated.</p>
  
  <p>The source for the layout and a screenshot are pasted below. An example of a layout that works properly is also listed.</p>
  
  <p>Thank you!</p>
  
  <p>layout.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      tools:context=".churches.ChurchesActivity"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/toolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              android:background="?attr/colorPrimary"
              app:popupTheme="@style/AppTheme.PopupOverlay" /&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
      &lt;android.support.design.widget.CoordinatorLayout
          android:id="@+id/coordinatorLayout"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          &gt;
  
          &lt;FrameLayout
              android:id="@+id/contentFrame"
              android:layout_width="match_parent"
              android:layout_height="match_parent"/&gt;
      &lt;/android.support.design.widget.CoordinatorLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>styles.xml</p>
  
  <pre><code>&lt;resources&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;style name="AppTheme.NoActionBar"&gt;
      &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
      &lt;item name="windowNoTitle"&gt;true&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;
  </code></pre>
  
  <p></p>
  
  <p>styles-v21.xml</p>
  
  <pre><code>&lt;resources&gt;
  
  &lt;style name="AppTheme.NoActionBar"&gt;
      &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
      &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
      &lt;item name="android:windowDrawsSystemBarBackgrounds"&gt;true&lt;/item&gt;
      &lt;item name="android:statusBarColor"&gt;@android:color/transparent&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p></p>
  
  <p>Status Bar is not colorPrimaryDark</p>
  
  <p><a href="https://i.stack.imgur.com/8yCv4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8yCv4.png" alt="Status Bar is not colorPrimaryDark"></a></p>
  
  <p>Status Bar is colorPrimaryDark</p>
  
  <p><a href="https://i.stack.imgur.com/IZMSm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IZMSm.png" alt="Status Bar is colorPrimaryDark"></a></p>