Iam trying to create a translucent theme on my activity but adding this theme into my manifest causes my application to crash.
android:theme="@android:style/Theme.Translucent.NoTitleBar"
Any particular reason for this behavior?
In Android, we can create a transparent activity that will not be visible but your application will be running. The best part of this transparent activity is that you can create a transparent activity by just changing the resource file and we need not write the java or kotlin code for the same.
You're probably using the activity class from the support library, i.e. AppCompatActivity
.
It requires you to use a support theme, which don't include a transparent activity. You can create a custom translucent theme for AppCompat like this.
Or use a different activity class:
public class MainActivity extends Activity {
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With