androidwindowtransparent

Android: Set windowIsTranslucent from Activity


I'm developing a library where I have to set the window background programmatically and I can't use custom style XMLs. The idea is that the user who implements the library can set any theme he want - I just need to make the background transparent. So all the styles for the widgets will stay the same.

I tried some window flags like WindowManager.LayoutParams.FLAG_DIM_BEHIND and WindowManager.LayoutParams.FLAG_BLUR_BEHIND, but none of them was working.

Every solution that I've found is based on the style xml file.

Is there a way to set windowIsTranslucent directly from the code?

Thanks in advance, Roman


Solution

  • No, this is not possible.

    It is only possible to set windowIsTranslucent in your theme.

    Suggestion; Create your own theme that others can override.