In Oncreate()/OnResume(), I am trying to change the status bar color. But the color is set and resetting to default color immediately.
Below is my code in OnCreate(),
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor(ContextCompat.getColor(context, R.color.online_status_bar));
So here, green color will display but suddenly green color is changed to default color. Where am i going wrong?
Any immediate help is much appreciated.