How to change the color of the status bar in Android?

change status bar color android xml
change status bar color android programmatically
change status bar text color android
change status bar icon color android
android change status bar icon color programmatically
android status bar color/transparent
android status bar color/white
change notification background color android

I would like to change the color of highlighted bar in Android Studio:

How can i do it?

You can change it by setting the android:statusBarColor or android:colorPrimaryDark attribute of the style you're using for your app in styles.xml.

(android:statusBarColor inherits the value of android:colorPrimaryDark by default)

For example (since we're using an AppCompat theme here, the android namespace is omitted):

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorPrimaryDark">@color/your_custom_color</item>
</style>

On API level 21+ you can also use the Window.setStatusBarColor() method from code.

From its docs:

For this to take effect, the window must be drawing the system bar backgrounds with WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS and WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS must not be set. If color is not opaque, consider setting View.SYSTEM_UI_FLAG_LAYOUT_STABLE and View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN.

To set these flags you could do something like this:

// getWindow() is a method of Activity
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);

How to change the status bar color in Android?, Android 5.0 Lollipop introduced Material Design theme which automatically colors the status bar based on the colorPrimaryDark value of the theme. This is  In this way, you can change the status bar color of your Android device. To change the color of Navigation bar, open the GravityBox app and go to Navigation bar tweaks to tweak your navigation bar. That’s all! This is very simple and as easy as said. All you need is a rooted Android device.

The status bar is a system window owned by the operating system. On pre-5.0 Android devices, applications do not have permission to alter its color, so this is not something that the AppCompat library can support for older platform versions. The best AppCompat can do is provide support for coloring the ActionBar and other common UI widgets within the application.

On post-5.0 Android devices, Changing the color of status bar also requires setting two additional flags on the Window; you need to add the FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS flag and clear the FLAG_TRANSLUCENT_STATUS flag.

Window window = activity.getWindow();

// clear FLAG_TRANSLUCENT_STATUS flag:
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);

// add FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS flag to the window
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);

// finally change the color
window.setStatusBarColor(activity.getResources().getColor(R.color.my_statusbar_color));

How to Customize the Status Bar on Android (Without Rooting), If it fails to pick the right color for an app, or you just what something a little different, you can set custom colors for every individual app under App  Changing the color of the status bar is available only for devices with Android Lollipop (API 21) and higher. Therefore we would have to add a line of code that would check if the android version is at lease 21 or not and then try to change the color of the status bar. Color of the status bar can be changed both programatically (using Java) and through XML.

You can also add these lines of code in main activity

 if (Build.VERSION.SDK_INT >= 21) {
        getWindow().setNavigationBarColor(ContextCompat.getColor(this, R.color.dark_nav)); // Navigation bar the soft bottom of some phones like nexus and some Samsung note series  
        getWindow().setStatusBarColor(ContextCompat.getColor(this,R.color.statusbar)); //status bar or the time bar at the top
      }

How to change the Status bar color on Android, Here are a few tips and tricks to dynamically change the status bar color on your Android apps. After you open the application, you will see this option in the Settings Enable Color Status Bar in Settings. Once enabled, the notification panel will change, you will see 2 options below it and APPARENCE and QUICK SETTINGS, you can enable and disable it according to your need.

add the status bar color to your style and done

<item name="android:statusBarColor">@color/black</item>

this for API level 21

Setting Android Status Bar Background & Icon Colors, Status bar replacement apps have two methods of customization: themes or individual color selection. Themes are more comprehensive and will also change the  Here is how you can change the color of the status bar using the new window.setStatusBarColor method introduced in API level 21. Changing the color of status bar also requires setting two additional flags on the Window ; you need to add the FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS flag and clear the FLAG_TRANSLUCENT_STATUS flag.

<item name="colorPrimaryDark">@color/your_color</item> 

will only be visible in Lollipop and greater than Lollipop(API) devices. P.S. you need to have Theme.AppCompat as your base/main theme

How to Change the Color of a Status Bar on Android, This example demonstrates how do I change the status bar color to match app Android.Step 1 − Create a new project in Android Studio, go to  It is fairly simple to do and works on Android Lollipop and above. Please take a note that: Android 5.0 Lollipop introduced Material Design theme which automatically colors the status bar based on the ColorPrimaryDark value of the theme. There are two ways of changing the StatusBar color, First one using Themes and second one Programatically. We will go through both these methods one by one.

How to change status bar color to match app Android?, when android:windowLightStatusBar is set to true, status bar text color will be able to be seen when the status bar color is white, and vice-versa  Here is how you can change the color of the status bar using the new window.setStatusBarColor method introduced in API level 21. Changing the color of status bar also requires setting two additional flags on the Window; you need to add the FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS flag and clear the FLAG_TRANSLUCENT_STATUS flag. Working Code:

Android: Change status bar text color - IMStudio, Please take a note that: Android 5.0 Lollipop introduced Material Design theme which automatically colors the status bar based on the  Since Android Lollipop (21) it is possible to set a custom status bar background colour by simply defining it in style.xml with a key colorPrimaryDark or programatically (check below). Text colour Since Android M (23) it is possible to set a predefined status bar text colour theme to light or dark.

Change StatusBar Color in Android Lollipop and Above, Under the settings you can change the color to be displayed. Each Post Type now can have seperate notification bar color. Choose the colors from the meta box 

Comments
  • Are you talking about status bar or bottom bar of phone or something else? please be more specific
  • @KDeogharkar The picture is telling all thing. I do not know the terminology.
  • ohk I am not able to see it. imgur is block from my end .my mistake
  • Possible duplicate of How to change the status bar color in android
  • outstanding, worked for me.