Android issue: You need to use a Theme.AppCompat theme (or descendant) with this activity
来源:互联网 发布:数据库事务的特性 编辑:程序博客网 时间:2024/04/28 11:44
报这个错一看就是要你使用:Theme.AppCompat theme
前提要有v7包:com.android.support:appcompat-v7
当然v4最好也有:com.android.support:support-v4
Activity可以直接使用<application/>定义的theme;也可以在<activity/>中加入 android:theme="…"
来指定主题。
比较坑的是,最近接手一个老项目,没用Theme.AppCompat;然后我用了v7, 使用了AppCompatActivity,结果就报这错了。
这里坑我的是:明明说使用这个Theme.AppCompat或其派生的子theme就可以;结果多一个层次的继承还是报错,如:
<!-- base theme. --><style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar" /><!-- Application theme. --><style name="AppTheme" parent="AppBaseTheme" />
如上,在使用时,用@style/AppTheme,就照样报错了(测试机小米2s,5.0系统)…
不得不去掉base theme:
<!-- Application theme. --><style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar" />
阅读全文
0 0
- 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
- 【Android】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 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 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.
- 关于“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
- SpringMvc的学习之路(一)
- JAVA设计模式详解
- 刷题——Protecting the Flowers POJ
- SPFA算法模板
- 多进程导致Application多次启动
- Android issue: You need to use a Theme.AppCompat theme (or descendant) with this activity
- c++文件读写的简单例子
- hdu 6129 杨辉三角(递推好题)
- java date类型和calendar类型区别及date格式化
- Cocos2D-x精灵的简单实现和函数调用基本流程
- 根据位数逆推阶乘
- hdu 2119 Matrix
- 两个Integer对象比较
- hyperledger fabric的实现用到的技术和知识