Why the background of ProgressDialog doesn't set to the transparent?

create custom MyTheme in values\styles.xml

<style name="MyTheme" parent="android:Theme.Holo.Dialog">
    <item name="android:alertDialogStyle">@style/CustomAlertDialogStyle</item>
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:textColorPrimary">#FFFFFF</item>
     <item name="android:backgroundDimEnabled">false</item>
    <item name="android:textColor">#FFFFFF</item>
    <item name="android:textStyle">normal</item>
    <item name="android:textSize">12sp</item>
</style>

And also add this CustomAlertDialogStyle in values\styles.xml

 <style name="CustomAlertDialogStyle">
<item name="android:bottomBright">@android:color/transparent</item>
<item name="android:bottomDark">@android:color/transparent</item>
<item name="android:bottomMedium">@android:color/transparent</item>
<item name="android:centerBright">@android:color/transparent</item>
<item name="android:centerDark">@android:color/transparent</item>
<item name="android:centerMedium">@android:color/transparent</item>
<item name="android:fullBright">@android:color/transparent</item>
<item name="android:fullDark">@android:color/transparent</item>
<item name="android:topBright">@android:color/transparent</item>
<item name="android:topDark">@android:color/transparent</item>
</style>

And set ProgressDialog like:

 pd = new ProgressDialog(getActivity(),R.style.MyTheme);
 pd.setCancelable(false);
 pd.setProgressStyle(android.R.style.Widget_ProgressBar_Small);
 pd.show();

You can use this code,work fine in devices >= 19 (Kitkat)

progress = ProgressDialog.show(Splash.this, null, null, true);
            progress.setContentView(R.layout.elemento_progress_splash);
            progress.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));

            //progress.show();

enter image description here


Try this

mProgressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));

EDIT:

Try adding this to the layout xml

        <item name="android:backgroundDimEnabled">true</item>
        <item name="android:background">@android:color/transparent</item>