I have a question about how to change the color of the status bar (StatusBar) of my application when the SDK version on the device is greater than or equal to 4.0 (API 14) . I currently have the following for when the SDK is greater than or equal to version 5.0 (API 21) and which works correctly for me:
public class LoginActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
isColorNotifications();
}
....
....
private void isColorNotifications(){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryDark));
}
}
}
Maybe someone can give me some clue.
Thank you in advance.