Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: How to Change ProgressDialog's Text Color? [duplicate]

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.

like image 450
Ogulcan Orhan Avatar asked May 09 '12 22:05

Ogulcan Orhan


1 Answers

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((.

like image 153
JustAnotherCoder Avatar answered Sep 19 '22 21:09

JustAnotherCoder