Custom progressdialog in android created dynamically -


i've created progressdialog in asynctask dynamically. use custom style app. when did progressdialog style changed white color need default style in black white text.

my java file:

class logintask extends asynctask<void, void, void> {  private final progressdialog dialog = new progressdialog(login.this);  @override protected void onpreexecute() {     this.dialog.setmessage("logging in...");     this.dialog.show(); }   // prog  @override     protected void onpostexecute(void result) {         if (this.dialog.isshowing()) {         this.dialog.dismiss();         }} 

my style.xml :

 <style name="appbasetheme" parent="android:theme.light">  </style>  <!-- application theme. --> <style name="apptheme" parent="appbasetheme">     <!-- customizations not specific particular api-level can go here. -->     <item name="android:windowbackground">@drawable/blue</item>     <item name="android:textcolor">@color/white</item>     <item name="android:edittextcolor">@color/white</item>     <item name="android:buttonstyle">@android:style/widget.holo.button</item>     <item name="android:dropdownspinnerstyle">@android:style/widget.holo.spinner</item>     <item name="android:textappearancebutton">@android:style/textappearance.widget.button</item>     <item name="android:progressbarstyle">@style/progressbar</item>  </style> <style name="progressbar" parent="@style/android:theme.holo">     <item name="android:textcolor">@color/red</item>     <item name="android:background">@color/green</item> </style> 

change below line pass style through constructor...

private final progressdialog dialog = new progressdialog(login.this); 

to this...

private final progressdialog dialog = new progressdialog(login.this, r.style.progressbar); 

update:

i change style below...and working for.

<style name="progressbar" parent="@style/android:theme.holo">     <item name="android:textcolor">#ffffff</item>     <item name="android:background">#000000</item> </style> 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

angularjs - ng-repeat duplicating items after page reload -