Android Studio: You need to use a Theme.AppCompat theme (or descendant) with this activity.
来源:互联网 发布:淘宝让上传身份证清关 编辑:程序博客网 时间:2024/03/29 02:56
错误描述为:
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
起因:
我想在Manifest中设置我的activity全屏,代码如下:
activity android:name=".SplashActivity" android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen">
原因:
从错误提示中提到Theme.AppCompat theme,这是因为我们的activity一定是继承了兼容包中的类,
比如我这里默认继承了AppCompatActivity,它来自android.support.v7.app.AppCompatActivity。
所以就要使用与其配合的AppCompat的theme才行。
解决:
方法1.根据提示来使用AppCompat的theme,如下:
ndroid:theme="@style/Theme.AppCompat.NoActionBar"
方法2:
如果不是那么强烈需要继承自ActionBarActivity,就直接继承Activity吧。问题自然搞定!
1 0
- Android Studio 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
- Android Studio: 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
- 【Android】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.
- Android问题一: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解决方案
- Android异常-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
- Android issue: 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
- 魅族手机权限开启方法5
- 史上最难oracle数据库练习题(附答案)
- 水位下降
- 数据库设计 从入门至初级
- Openstack 架构简述
- Android Studio: You need to use a Theme.AppCompat theme (or descendant) with this activity.
- <<大数据分析在流量调度的应用>>孙子荀
- 前端知识推荐
- java 生成验证码
- 手机端通过Es文件浏览器访问windows服务器用File Zilla Sever软件 分享的文件
- TCP三次握手及四次挥手详细图解
- poj 1066 Treasure Hunt (线段相交判定)
- 迷宫day3
- 对汇编语言中负数舍入误差的理解