Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant)
JAVA to or by use lang you need
2023-09-11 14:22:08 时间
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.healthmanager/com.example.healthmanager.LoginActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
解决办法:检查 values 目录下的 style.xml文件,修改定义的style名称和parent,是否有多的 </style>
标签,修改Theme例如:
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="android:windowNoTitle">true</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
更多资源请关注作者专栏。
相关文章
- Java学习之java高级特性
- 大杂烩 -- Java内存布局【图】以及java各种存储区【详解】
- sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class异常解决方法
- java.rmi.ConnectException: Connection refused to host: 127.0.0.1
- Java Design Demo -简单的队列-异步多任务队列(java android)
- AIDL 发生异常的原因 Android java.lang.SecurityException: Binder invocation to an incorrect interface
- java Collection接口
- java中String数组和List的互相转化
- java.lang.OutOfMemoryError: Java heap space
- How to Use Verbose Options in Java
- Java学习-070-多线程03:Thread 类和 Runnable 接口的联系和区别
- 毕业设计 Java动态旅游网站设计与实现
- Java打印输出:java在线8x8x
- 浅析Java对集合进行操作时报java.util.ConcurrentModificationException并发修改异常问题:产生原因、单线程/多线程环境解决、CopyOnWriteArrayList线程安全的ArrayList、fail-fast快速失败机制防止多线程修改集合造成并发问题
- unexpected token: * 和 java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to 解决办法
- Java之throw和throws的区别及java中的异常处理
- Java中关键字volatile的作用
- 九度OJ #1437 To Fill or Not to Fil
- How to set JAVA environment variables in Linux or CentOS
- Java分布式锁
- 《To prune, or not to prune:exploring the efficacy of pruning for model compression》论文笔记
- 解决Java整合minio错误:S3 API Request made to Console port. S3 Requests should be sent to API port
- Java 创建 List 和 Map 同时赋初值的 5 种方式