Android: How to Change ProgressDialog's Text Color?

Ogulcan Orhan picture Ogulcan Orhan · May 10, 2012 · Viewed 12.4k times · Source

Possible Duplicate:
Transparent, borderless ProgressDialog

I'm using Theme.Light in my app. While using Progress Dialog, text of dialog color is black and it's not encouraging.

I tried this change only dialog's text color, but didn't work:

<style name="Theme.MyDialog" parent="@android:style/Theme.Dialog">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:textColor">#FFFFFF</item>
</style>

Do I have to set the style (MyDialog) in any XML? Or how can I change dialog's text color?

Thanks in advance.

Answer

JustAnotherCoder picture JustAnotherCoder · May 29, 2012

Apply your custom theme in ProgressDialog constructor:

ProgressDialog progressDialog = new ProgressDialog(this, R.style.Theme_MyDialog);

also change <item name="android:textColorSecondary">*my_text_color*</item> in this theme. In my case it's work on emulator and Acer LicuidE, but Samsung Galaxy Mini don't want to set my custom color for text((.