java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
来源:互联网 发布:福岛 知乎 编辑:程序博客网 时间:2024/05/19 18:37
错误描述为:
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
- 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)
- 数据缓存(图片)
- 3台机器部署zookeeper-3.4.10集群
- CS231n系列课程Lecture6: Training Neural Networks, Part 2
- JAVA集合框架——Iterator
- Linux生成密钥
- java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this a
- 分数加减法
- [P2472]蜥蜴
- LeetCode 3. Longest Substring Without Repeating Characters 滑动窗口
- 离开工具自己手写一个servlet
- 深入理解java异常处理机制
- 聚类系列-Affinity Propagation
- 欢迎使用CSDN-markdown编辑器
- 并查集详解 (转)