Change status bar color to match app in Android above Lollipop

Window window = activity.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor(ContextCompat.getColor(activity, R.color.example_color));

References
https://stackoverflow.com/questions/27093287/how-to-change-status-bar-color-to-match-app-in-lollipop-android