Create a transparent dialog on top of activity Create a transparent dialog on top of activity android android

Create a transparent dialog on top of activity


Just change the background color of your Dialog:

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

Edit:

This prevents the dim effect:

dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);


Just add this, it really works!

<item name="android:windowIsTranslucent">true</item>        <item name="android:windowCloseOnTouchOutside">true</item>        <item name="android:windowBackground">@android:drawable/alert_dark_frame</item>        <item name="android:windowContentOverlay">@null</item>        <item name="android:windowNoTitle">true</item>        <item name="android:windowIsFloating">true</item>        <item name="android:backgroundDimEnabled">false</item>