change status bar color in android studio

Solutions on MaxInterview for change status bar color in android studio by the best coders in the world

showing results for - "change status bar color in android studio"
Tommaso
15 Aug 2018
1if (Build.VERSION.SDK_INT >= 21) {
2            Window window = this.getWindow();
3            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
4            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
5            window.setStatusBarColor(this.getResources().getColor(R.color.colorPrimaryDark));
6        }
7