Q: Correct way to set StatusBar color on Android I have made a blank starter app with default theme (Ionic 5). 
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.

The status bar is black. What is the correct way to set the color of the status bar to some other color?
I have tried the following things:


*

*StatusBar

this.statusBar.backgroundColorByHexString('#ffffff');


*StatusBar color in preferences

<preference name="StatusBarBackgroundColor" value="#457492" />

But none of these work. For now, I have resorted to doing this through the Android project's MainActivity.

getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.status_bar_color));

app.component.ts
export class AppComponent {
  navigate: any;
  constructor(
    private platform: Platform,
    private splashScreen: SplashScreen,
    private statusBar: StatusBar
  ) {
    this.initializeApp();
  }

  initializeApp() {
    this.platform.ready().then(() => {
      // this.statusBar.styleDefault();
      this.splashScreen.hide();
      this.statusBar.backgroundColorByHexString('#ff371d');
      this.sideMenu();
    });
  }
}


A: You can set Statusbar color in your parent theme also.
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
       ...
        <item name="android:statusBarColor">#ffffff</item>
       ...

    </style>


A: Do you change the color after platform.ready()?
this.platform.ready().then(() => {
   this.statusBar.backgroundColorByHexString('#A9C23F');
}

I did not change anything in the config and this is working for me

A: Add this line in the style.xml: 
item name="colorPrimaryDark">@color/colorPrimaryDark</item>

or
item name="colorPrimaryDark">#0000</item>


