Android例外:您需要在此活动中使用Theme.AppCompat主题 [英] Android exception: You need to use a Theme.AppCompat theme with this activity
本文介绍了Android例外:您需要在此活动中使用Theme.AppCompat主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为了使用支持操作栏,我的活动必须扩展ActionBarActivity,并且当我这样做并开始活动时,应用程序将崩溃,并显示以下信息:
In order to use the support action bar, my activity has to extend ActionBarActivity, and when I do that and start the activity, the application crashes with:
例外:此活动需要使用Theme.AppCompat主题(或后代).
Exception: You need to use a Theme.AppCompat theme (or descendant) with this activity.
在我的styles.xml中,
In my styles.xml I have
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light"></style>
在我的AndroidManifest.xml中,我有违规行为
And in my AndroidManifest.xml for the offending activity I have
<activity android:name="com.example.test3.SettingsActivity"
android:theme="@style/AppBaseTheme" />
推荐答案
您必须检查其他包含样式文件的文件夹,这些文件夹可能会覆盖您的样式.
You have to check for other folders, that contain styles files as well, that could possibly override your styles.
这篇关于Android例外:您需要在此活动中使用Theme.AppCompat主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文