How can i make an activity appear in the center of the screen like a dialog while the previous activity(the activity that call the intent for the transparent one)
remains visible in the background ? I tried setting gravity as center and background as #00000000 as seen in other answers but it doesnt work as seen in other answers.
Asked
Active
Viewed 9,872 times
2

Philipp Jahoda
- 50,880
- 24
- 180
- 187

mremremre1
- 1,036
- 3
- 16
- 34
-
http://stackoverflow.com/questions/2176922/how-to-create-transparent-activity-in-android – Sep 03 '13 at 16:35
-
Check this work for me http://stackoverflow.com/questions/2176922/how-to-create-transparent-activity-in-android/38589105#38589105 – Naeem Ibrahim Jul 26 '16 at 11:52
1 Answers
9
Try to mention your style like this then this will shown as a dialog and transparent..
<style name="DialogTheme" parent="android:Theme.Dialog">
<!-- No backgrounds, titles or window float -->
<item name="android:windowBackground">@null</item>
<item name="android:windowIsTranslucent">true</item>
</style>
In your activity apply theme like this..
<activity
android:name="com.afbb.smartlock.activitys.PreviewImagesActivity"
android:theme="@style/DialogTheme" >
</activity>

kalyan pvs
- 14,486
- 4
- 41
- 59