I want to make a transparent activity

Asked 2 years ago, Updated 2 years ago, 173 views

I want to make a transparent activity on top of other activities What do I do?

android android-activity transparent

2022-09-22 10:36

1 Answers

res/values/styles.xml Go in here

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <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>
</resources>

Do it like this @color/transparentThis value is res/values/color.xml where Please make it into #00000000

After that, I went into the Android Manifest file

<activity android:name=".SampleActivity" android:theme="@style/Theme.Transparent">
...
</activity>

Please


2022-09-22 10:36

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.