title: Correct way to set StatusBar color on Android
body: <p>I have made a blank starter app with default theme (Ionic 5). </p>
  
  <p>For Android, this is how it looks. This looks quite odd, as I was expecting a darker version of the primary color to be used as the color of the status bar.</p>
  
  <p><a href="https://i.stack.imgur.com/FQxap.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FQxap.png" alt="enter image description here"></a></p>
  
  <p><strong>The status bar is black. What is the correct way to set the color of the status bar to some other color?</strong></p>
  
  <p>I have tried the following things:</p>
  
  <ol>
  <li>StatusBar
  <code>
  this.statusBar.backgroundColorByHexString('#ffffff');
  </code></li>
  <li>StatusBar color in preferences
  <code>
  &lt;preference name="StatusBarBackgroundColor" value="#457492" /&gt;
  </code></li>
  </ol>
  
  <p>But none of these work. For now, I have resorted to doing this through the Android project's MainActivity.</p>
  
  <p><code>
  getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.status_bar_color));
  </code></p>
  
  <p><strong>app.component.ts</strong></p>
  
  <pre><code>export class AppComponent {
    navigate: any;
    constructor(
      private platform: Platform,
      private splashScreen: SplashScreen,
      private statusBar: StatusBar
    ) {
      this.initializeApp();
    }
  
    initializeApp() {
      this.platform.ready().then(() =&gt; {
        // this.statusBar.styleDefault();
        this.splashScreen.hide();
        this.statusBar.backgroundColorByHexString('#ff371d');
        this.sideMenu();
      });
    }
  }
  </code></pre>