java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
来源:互联网 发布:mysql 分页 offset 编辑:程序博客网 时间:2024/06/06 00:32
起因:
我想在Manifest中设置我的activity全屏,代码如下:
原因:
从错误提示中提到Theme.AppCompat theme,这是因为我们的activity一定是继承了兼容包中的类,
比如我这里就无意中继承了ActionBarActivity,它来自android.support.v7.app.ActionBarActivity。
所以就要使用与其配合的AppCompat的theme才行。
解决:
1.根据提示来使用AppCompat的theme,如下:
不过我要设置全屏,但我并没有找到,所以虽然错误不见了,但并没有达到我的预期。
2.如果不是那么强烈需要继承自ActionBarActivity,就直接继承Activity吧。问题自然搞定!
还有其他的情况,也会报这个错误,比如下面这个……
包导错了,我的是一个Dialog导入包出现这个错误:
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
我的是这里的上下文传错了。
阅读全文
1 0
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this
- 异常IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
- eclipse:java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) wit
- Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant)
- Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant)
- Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant)
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant
- Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant)
- Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant)
- 每天一个linux命令(36):diff 命令
- Unity3d游戏 轻功设计
- mysql表锁机制详解
- c++通过TCP/IP协议提交POST信息登录到PHPChina中文开发者社区
- 腾讯云挂载磁盘
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- 【C++】int 转换为string的两种方法(to_string ,字符串流)
- 在Python中使用protocol buffers参考指南
- 欢迎使用CSDN-markdown编辑器
- 哼哼
- 清理缓存<meta http-equiv="Pragma" content="no-cache">
- Android 存储路径详解
- (win10/ubuntu)dlib-python安装
- Hello Word