Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android:theme="@android:style/Theme.Translucent.NoTitleBar" causing my activity to crash

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?

like image 608
Naman Choradia Avatar asked May 22 '15 18:05

Naman Choradia


People also ask

What is translucent activity android?

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.


1 Answers

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 {
like image 101
Simas Avatar answered Sep 28 '22 10:09

Simas