title: Android: Status Bar is White
body: <p>For some reason, the status bar is now white. Or rather, an off white, with another shade of white for the icons faintly visible against the bright background. Which is wrong, because my appbarlayout uses a blue shade as its color. Up until now, this has been working fine, I don't know what I did to cause this. I've tried manually setting the statusBarColor to colorPrimaryDark (#0277bd), but it's not working.</p>
  
  <p>I just don't know why this is happening in the first place. I'm pasting my activity's layout.xml, maybe someone can clue me in to what I'm doing wrong here.</p>
  
  <p>A few notes:</p>
  
  <p>The themes used haven't been changed from their defaults, which are to use the primary color settings. I changed those to the right shade of blue that I wanted, but when I did that change everything was working.</p>
  
  <p>My layout.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout 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:statusBarColor="@color/colorPrimaryDark"
      tools:context=".activities.ContactsActivity"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:id="@+id/contactsActivityAppbar"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:fitsSystemWindows="true"
          android:statusBarColor="@color/colorPrimaryDark"
          android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/contactsActivityToolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              app:popupTheme="@style/AppTheme.PopupOverlay"/&gt;
          &lt;!-- app:layout_scrollFlags="scroll|enterAlways" --&gt;
  
          &lt;android.support.design.widget.TabLayout
              android:id="@+id/contactsActivityTabs"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              app:tabIndicatorColor="@android:color/white"
              android:scrollbarStyle="insideOverlay"
              android:paddingBottom="1dp"
              android:background="@color/colorPrimary"/&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;android.support.v4.view.ViewPager
          android:id="@+id/contactsTabsViewPager"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"/&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>colors.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
      &lt;color name="colorPrimary"&gt;#0288d1&lt;/color&gt;
      &lt;color name="colorPrimaryDark"&gt;#0277bd&lt;/color&gt;
      &lt;color name="colorAccent"&gt;#FF4081&lt;/color&gt;
  &lt;/resources&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;
  
  &lt;/resources&gt;
  </code></pre>
  
  <p>Edit: Ok, found an interesting solution, really want to understand it, not just rely on it. Also, it might not be the best answer long term.</p>
  
  <p>Anyway, to the base application theme (AppTheme) in styles.xml, I added the following line:</p>
  
  <pre><code>&lt;item name="android:windowBackground"&gt;@color/colorPrimaryDark&lt;/item&gt;
  </code></pre>
  
  <p>It worked, it made the background of everything that I didn't specifically assign a color that color. But it also made the status bar that color, so I went through and added my own backgrounds to other things to fix them.</p>
  
  <p>I feel like this isn't the ideal solution, though, and would just like more feedback in general. Also, even without this line before, it was coloring the status bar just fine. I have no idea what I did to break it in the first place.</p>
  
  <p>Thanks.</p>
  
  <p>Edit: Here is the activity code. Thanks.</p>
  
  <pre><code>import android.content.Intent;
  import android.os.Bundle;
  import android.support.design.widget.TabLayout;
  import android.support.v4.view.ViewPager;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.Toolbar;
  import android.view.Menu;
  import android.view.MenuItem;
  
  import io.craigmiller160.contacts5.R;
  import io.craigmiller160.contacts5.fragments.ContactsGroupsFragmentPage;
  import io.craigmiller160.contacts5.fragments.ContactsListFragmentPage;
  import io.craigmiller160.contacts5.fragments.ContactsTabsPagerAdapter;
  
  public class ContactsActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_contacts);
  
          Toolbar toolbar = (Toolbar) findViewById(R.id.contactsActivityToolbar);
          setSupportActionBar(toolbar);
  
          ViewPager viewPager = (ViewPager) findViewById(R.id.contactsTabsViewPager);
  
          ContactsTabsPagerAdapter adapter = new ContactsTabsPagerAdapter(getSupportFragmentManager());
          adapter.addFragmentPage(new ContactsListFragmentPage(), "Contacts");
          adapter.addFragmentPage(new ContactsGroupsFragmentPage(), "Groups");
          viewPager.setAdapter(adapter);
  
          TabLayout tabLayout = (TabLayout) findViewById(R.id.contactsActivityTabs);
          tabLayout.setupWithViewPager(viewPager);
  
      }
  
      @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.displaySettings) {
              Intent intent = new Intent(this, DisplaySettingsActivity.class);
              startActivity(intent);
              return true;
          }
  
          return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>