Skip to content

Instantly share code, notes, and snippets.

@kibotu
Created May 29, 2016 13:25
Show Gist options
  • Save kibotu/589038efe93d7591e051541b86b6de54 to your computer and use it in GitHub Desktop.
Save kibotu/589038efe93d7591e051541b86b6de54 to your computer and use it in GitHub Desktop.
Change Status Bar color during runtime on android
public static void changeStatusBarColor(final int color) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
return;
final Window window = getActivity().getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(color);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment