0

i don't know how to change the text of the status bar on android API 29. i want change the text and icon to black color. How to fix it please?

i tried this, but i have an error: error

zou naa
  • 1
  • 4
  • 3
    Does this answer your question? [Android statusbar icons color](https://stackoverflow.com/questions/30075827/android-statusbar-icons-color) – gioravered Sep 14 '21 at 19:09

1 Answers1

0

UPDATING MIN API FROM 21 TO 23

you just need to go in your app's build.gradle file and change version like this:

android {
    ....
    
    defaultConfig {
         ...
         minSdk 23   // just replace minSdk 21 with minSdk 23 here
         ...
    }
}

UPDATE:

Inside your themes.xml file in the res -> values , you should add these 2 attributes. This produces the following output on API level 30 for me. (Image below)

<resources>

<style>

    <!-- Status bar color. -->
    <item name="android:statusBarColor" tools:targetApi="l">@color/white</item>
    <item name="android:windowLightStatusBar">true</item>    

</style>

</resources>

enter image description here

Old Answer:

try this inside your Activity's onCreate() method and let me know if that works as expected for you :)

window.statusBarColor = resources.getColor(R.color.colorPrimaryDark)
mehul bisht
  • 682
  • 5
  • 15