progress dialog spinner color not showing in some devices

时间:2018-02-03 11:15:43

标签: java android xml

i'm defined progress dialog like this :

public void onProgressChanged(WebView view, int newProgress) {
            super.onProgressChanged(view, newProgress);

            if (newProgress < 100) {
                progressDialog.setMessage("Loading ...");
                progressDialog.show();
            } else if (newProgress == 100){
                if (progressDialog!=null && progressDialog.isShowing()){
                    progressDialog.dismiss();
                }
            }

the style for progress dialog it's like this it has green spinner color and grey background :

<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:textColor">@color/colorWhite</item>
    <item name="android:background">@color/blue_grey_800</item>
</style>

the problem is when it's launched in my friend phone Samsung Galaxy J2 Prime(Android 6.0) the progressdialog is showed but without spinner.

i've tested in android emulator using same os 6.0 it's showing no problem.

anyone could tell me the problem, i'm really new on this.

1 个答案:

答案 0 :(得分:0)

It's probably caused by the theme colors on the device. Try changing the colorAccent or setting the background for the ProgressDialog.