Android5 (LOLLIPOP, API-21) and above versions can set the status bar (status bar, where the time and battery information are displayed) color
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Window window = getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.setStatusBarColor(ContextCompat.getColor(this, R.color.colorPrimary)); }
refer
How to change the status bar color in android
How to change status bar color to match app in Lollipop