You Need to Use a Theme.Appcompat Theme (Or Descendant) with This Activity. Change to Theme.Appcompat Causes Other Error

How to fix: You need to use a Theme.AppCompat theme (or descendant) with this activity

Your application has an AppCompat theme

<application
android:theme="@style/AppTheme">

But, you overwrote the Activity (which extends AppCompatActivity) with a theme that isn't descendant of an AppCompat theme

<activity android:name=".MainActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >

You could define your own fullscreen theme like so (notice AppCompat in the parent=)

<style name="AppFullScreenTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>

Then set that on the Activity.

<activity android:name=".MainActivity"
android:theme="@style/AppFullScreenTheme" >

Note: There might be an AppCompat theme that's already full screen, but don't know immediately

You need to use a Theme.AppCompat theme (or descendant) with this activity

The reason you are having this problem is because the activity you are trying to apply the dialog theme to is extending ActionBarActivity which requires the AppCompat theme to be applied.

Update: Extending AppCompatActivity would also have this problem

In this case, change the Java inheritance from ActionBarActivity to Activity and leave the dialog theme in the manifest as it is, a non Theme.AppCompat value


The general rule is that if you want your code to support older versions of Android, it should have the AppCompat theme and the java code should extend AppCompatActivity. If you have *an activity that doesn't need this support, such as you only care about the latest versions and features of Android, you can apply any theme to it but the java code must extend plain old Activity.


NOTE: When change from AppCompatActivity (or a subclass, ActionBarActivity), to Activity, must also change the various calls with "support" to the corresponding call without "support". So, instead of getSupportFragmentManager, call getFragmentManager.

Error You need to use a Theme.AppCompat theme (or descendant) with activity

Solution is change the Java inheritance from ActionBarActivity to Activity and leave the dialog theme in the manifest as it is, a non Theme.AppCompat value

In your case issue is with your manifest file you haven't specified android:theme="@style/AppTheme.NoActionBar" inside activities tag

Go your manifest file and replace splash activity with this:

<activity
android:name=".activities.SplashActivity"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Inside your splash activity class do this:

public class SplashActivity extends AppCompatActivity

Android You need to use a Theme.AppCompat theme (or descendant) with the design library

try this changes:

in gradle:

compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.android.support:design:25.2.0'

Also in manifest add the appcompat theme to your Navaigation drawer `Activity

<activity android:name=".activity.FormActivity"
android:theme="@style/Theme.AppCompat">
<intent-filter>
<action android:name="info.androidhive.navigationdrawer.activity.FormActivity" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

Issue with You need to use a Theme.AppCompat theme (or descendant) with this activity Theme.AppCompat theme (or descendant) with this activity

So since the comment I posted worked for you, I decided to post ehr solution here in order to give it more visibility and help other users.

SOLUTION

Hou have to set the theme to your BowlerActivity in your Manifest.

<activity 
androidd:name=".views.BowlerActivity"
android:theme="@style/AppTheme" />


Related Topics



Leave a reply



Submit