0

When I call an progressDialog the whole window (background behind the progressDialog) is getting dark/grey.

I tried:

alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));

But this changes the background of the progressDialog it self. Is it possible to disable the dark/grey background behind the progressDialog?

Mike
  • 3,200
  • 5
  • 22
  • 33
  • http://stackoverflow.com/questions/25174165/transparent-alertdialog-has-black-background – Adnan Mar 20 '16 at 18:07
  • @Adnan this changes the background of the alertDialog it self – Mike Mar 20 '16 at 18:08
  • This is standard system behavior, why would you want to change it? – Egor Mar 20 '16 at 22:47
  • because I am refreshing a live-image and the black/grey background disturbs the viewing of the image. showing the progressDialog without the full-window-background would be great. – Mike Mar 20 '16 at 22:50

2 Answers2

0

Dialog with transparent overlay style.xml:

 <style name="TransparentDialog" parent="@style/Theme.AppCompat.Light">
        <item name="android:windowContentOverlay">@null</item>
</style>

Set this style in Dialog constructor: R.style.TransparentDialog

dieter_h
  • 2,707
  • 1
  • 13
  • 19
  • thank you! I updated my question. I changed alertDialog to progressDialog. When I use your answer, also the background of the progressDialog box gets transparent. – Mike Mar 20 '16 at 22:46
0

I got it working with this solution:

alertDialog.getWindow().setDimAmount(0);
Mike
  • 3,200
  • 5
  • 22
  • 33