1

Created own color in color.xml <color name="colorProgressBar">#006600</color>

In styles.xml

<style name="ProgressBarde">
        <item name="colorAccent">@color/colorProgressBar</item>
    </style>

and added this to the main .xml activity

<ProgressBar
            android:id="@+id/progressBar3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:indeterminate="true"
            android:theme="@style/ProgressBarde" />

As you can the I choosed green color for my progress bar. It's even changed to my android studio editor. But when run it on my real android device by usb It's not changing. Where is my mistake?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Brutal
  • 798
  • 1
  • 14
  • 37

1 Answers1

0

Are you running your app on a pre-Lollipop device? On these devices the Material-themed progress bars are not available. instead, they are replaced with the default Holo progress bar. You can try using a third-party library for this.

(This should have been a comment, but my reputation is too low.)

  • I am running on Samsung Galaxy s4 – Brutal Mar 11 '18 at 18:22
  • I mean what's your Android version? If it is below 5.0, then you could try using a library; if it's 5.0 or higher, then my answer is wrong and the bug lies somewhere else. Also, instead of using a library, try applying a tint to the progress bar on pre-lollipop devices: https://stackoverflow.com/a/15809803/6244733. It won't look material but it's close enough. – Phạm Nguyễn Hoàng Mar 11 '18 at 18:32
  • I have 4.2.2 ..then I'll try to test higher than 5.0 version – Brutal Mar 11 '18 at 18:37