You need to use a Theme.AppCompat theme (or descendant) with this activity.
来源:互联网 发布:苹果数据恢复 编辑:程序博客网 时间:2024/04/28 13:46
错误描述为:
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
起因:
我想在Manifest中设置我的activity全屏,代码如下:
原因:
从错误提示中提到Theme.AppCompat theme,这是因为我们的activity一定是继承了兼容包中的类,
比如我这里就无意中继承了ActionBarActivity,它来自android.support.v7.app.ActionBarActivity。
所以就要使用与其配合的AppCompat的theme才行。
解决:
1.根据提示来使用AppCompat的theme,如下:
不过我要设置全屏,但我并没有找到,所以虽然错误不见了,但并没有达到我的预期。
2.如果不是那么强烈需要继承自ActionBarActivity,就直接继承Activity吧。问题自然搞定!
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
起因:
我想在Manifest中设置我的activity全屏,代码如下:
原因:
从错误提示中提到Theme.AppCompat theme,这是因为我们的activity一定是继承了兼容包中的类,
比如我这里就无意中继承了ActionBarActivity,它来自android.support.v7.app.ActionBarActivity。
所以就要使用与其配合的AppCompat的theme才行。
解决:
1.根据提示来使用AppCompat的theme,如下:
不过我要设置全屏,但我并没有找到,所以虽然错误不见了,但并没有达到我的预期。
2.如果不是那么强烈需要继承自ActionBarActivity,就直接继承Activity吧。问题自然搞定!
0 0
- 关于“you need to use a theme.appcompat theme (or descendant) with this activity”错误
- Android开发~you need to use a theme.appcompat theme (or descendant) with this activity
- You need to use a Theme.AppCompat theme (or descendant) with this activity
- You need to use a Theme.AppCompat theme (or descendant) with this activity解决方法
- You need to use a Theme.AppCompat theme (or descendant) with this activity.
- You need to use a Theme.AppCompat theme (or descendant) with this activity解决方法
- 【Android】You need to use a Theme.AppCompat theme (or descendant) with this activity解决方法
- You need to use a Theme.AppCompat theme (or descendant) with this activity
- You need to use a Theme.AppCompat theme (or descendant) with this activity解决
- you need to use a theme.appcompat theme (or descendant) with this activity 解决办法
- You need to use a Theme.AppCompat theme (or descendant) with this activity.
- You need to use a Theme.AppCompat theme (or descendant) with this activity.
- You need to use a Theme.AppCompat theme (or descendant) with this activity解决方法
- You need to use a Theme.AppCompat theme (or descendant) with this activity.
- 报错 You need to use a Theme.AppCompat theme (or descendant) with this activity.
- Android Studio You need to use a Theme.AppCompat theme (or descendant) with this activity解决方法
- 关于You need to use a Theme.AppCompat theme (or descendant) with this activity的问题
- You need to use a Theme.AppCompat theme (or descendant) with this activity解决方法
- 黑马程序员——用二维数组打印螺旋方阵和螺旋矩阵
- 如何从Android工程导出apk安装包
- 【C语言】数字字符串转换成这个字符串对应的数字。
- ListView (5)打造通用ViewHolder 和Adapter
- iOS SDK详解之IBInspectable和IB_DESIGNABLE-Storyboad动态刷新
- You need to use a Theme.AppCompat theme (or descendant) with this activity.
- zendstiduo背景色设置为保护眼睛的颜色》》》
- Android开发工具下载(历程分享亲测)
- 二叉树的线索化
- error C2227: left of '->first' must point to class/struct/union
- HDU ACM 1535 Invitation Cards单点到多源最短路->SPFA算法
- Johnson's Algorithm
- ThinkPHP中的MVC开发模式理解一
- 黑马程序员———Java基础——Java开发环境搭建