Heena Arora
Heena Arora

Reputation: 749

How to make dialog`s activity Transparent?

I am opening a dialog activity on click of notification in notification-bar, if the application is in foreground then dialog's activity is transparent on clicking of notification but if the application is in background in this case dialog-activity's background is appearing as black in-spite of transparent. I implemented this in styles.xml

<style name="Theme.Transparent" parent="android:Theme">
        <item name="android:windowIsTranslucent">true</item> 
        <item name="android:windowBackground">@android:color/transparent</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>   </style>

In manifest.xml for my activity I used

android:theme="@style/Theme.Transparent"

Upvotes: 1

Views: 1059

Answers (1)

Hardik
Hardik

Reputation: 17441

just set your theme in AndroidManifest.xml....

<activity
    android:name="com.example.YourDialogActivity"
    android:theme="@android:style/Theme.Translucent.NoTitleBar">
 </activity>

Upvotes: 1

Related Questions