Is there a way to programmatically make an Activity Window appear transluscent? For my purposes, I cannot use static XML resources.
I attempted to set the background resource to a transluscent color, but that only make the background appear solid black.
write it in your activity class
Window window = this.getWindow();
window.setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
Finally, I find a way to solve this problem.
https://github.com/ikew0ng/SwipeBackLayout/blob/e4ddae6d2b8af9b606493cba36faef8beba94be2/library/src/main/java/me/imid/swipebacklayout/lib/Utils.java
if you want to make a activity translucent
Utils.convertActivityToTranslucent(activity);
or if you want to make it opaque
Utils.convertActivityFromTranslucent(activity);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With