Android Remove Dialog Black Overlay Background (Kotlin)

class BusyDialogFragment: DialogFragment() {    override fun onStart() {        super.onStart()        // remove black outer overlay, or change opacity        dialog?.window?.also { window ->            window.attributes?.also { attributes ->                attributes.dimAmount = 0.1f                window.attributes = attributes            }        }    }}

NOTE: To make the white background transparent, refer to Set Dialog Background Transparent

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.