Sometimes we need to have android transparent activity and transparent screen in our Application, which is totally possible by playing around with the android activity and resource file a little bit. You can create transparent activity on android by applying the possible three ways to accomplish your goal.

Possible Solution 1

Look for the style.xml file in the resource folder, or simply go to res/values/styles.xml, open it and add the following code to it.

The value of @color/transparent is #000000, which you can add to your project. (if you’re not familiar to it then follow the below)

Now create another file in the resource folder and name it as “colors.xml” and paste the following code in it.

You can add more colors to it according to your needs.

In your activity file, you can now add the following transparent background to your activity tag.

If Your App is Crashing then it is derived from AppCompatActivity, so remove parent=”android:Theme” from the parent tag and it will start working.

[Android Error] Facing error in the intent filter? get your solution now. 

Possible Solution 2

Adding this code to your activity tag in manifest file will make android transparent activity. Assign Translucent Theme to the activity and it will work fine.

Possible Solution 3

This is also a possible way to create android transparent activity, just add that one line to your onCreate function, just below the setContentView which will make the background completely transparent.

For the dialogs, you can use this code to make an Android transparent activity

Final Words on Android Transparent Activity

These three possible solutions or ways can help you to create transparent activities on android. If none of them works for you just let us know in the comment section, we will try our best to get back to you as soon as possible. Please provide us with all the details, what you’ve already applied and little snap your code would be highly appreciated.

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!