Android studio IllegalStateException需要使用Theme.AppCompat主题
当我突然出现以下错误时,我的简单应用程序运行正常:Android studio IllegalStateException需要使用Theme.AppCompat主题,android,Android,当我突然出现以下错误时,我的简单应用程序运行正常: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.androi
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bazapp.bazapp">
<uses-permission android:name="android.permission.INTERNET" />
<application>
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
出什么事了?我已经搜索过了,但在任何答案中都找不到答案
编辑
我已经试过了这个问题上的所有东西,这个被指责是重复的,没有一个有效。主要答案建议将ActionBarActivity
更改为Activity
。我已经这样做了,所以我现在有:
public class MainActivity extends Activity {
这给了我一个错误
cannot find symbol class Activity
您需要做的就是将主题更改为AndroidManifest.xml文件中应用程序标记中的android:theme=“@style/theme.AppCompat.Light”。您的应用程序主题必须继承自
theme.AppCompat
或其后代。可能重复我已经查看了该问题的答案,但没有一个解决了我的问题。
cannot find symbol class Activity