Try it !. It worked very well!
in onCreate ()
final int baseAlpha = (0x99000000) >>> 24;
layout.setBackgroundColor(baseAlpha);
to manifest
<activity
android:name=".ui.web.WebPopupActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.TransparentWebPopup" />
in style.xml
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowEnableSplitTouch">false</item>
<item name="android:splitMotionEvents">false</item>
</style>
<style name="AppTheme.TransparentWebPopup" parent="AppTheme.NoActionBar">
<item name="android:windowBackground">@color/color_trans</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
</style>
in color.xml
<color name="color_trans">#99000000</color>
source
share