android开发Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or des
来源:互联网 发布:刷卡消费系统源码 编辑:程序博客网 时间:2024/06/05 01:54
错误日志:
09-05 02:40:05.021 1639-1639/? E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.administrator.demo/com.example.administrator.demo.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:356)
at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:325)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:286)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.example.administrator.demo.MainActivity.onCreate(MainActivity.java:39)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
解决办法:
在自己的AndroidManifest.xml文件中,改下自己的风格配置就行。
原来配置:
android:theme="@style/AppTheme"
改成现在;
android:theme="@style/Theme.AppCompat"
- android开发Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or des
- 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)
- 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)
- Android开发丶Caused by: java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or
- Android去標題時報錯:java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendan
- android 引入ActionBar报错Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat t
- 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
- C++ primer 第十章 对象和类
- linux常用命令之文件处理命令
- String、StringBuffer、与StringBuilder的区别
- Python IDE
- Java:使用POI实现word的docx文件的模板功能
- android开发Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or des
- 使用SpringMVC上传多文件
- 彻底搞懂nodejs事件循环 Event Loop
- java web学习总结45:监听器(Listener)学习二
- Redis缓存方法封装
- postgresql定义字段类型
- 推荐系统的基本原理
- MAC 系统 单独安装的python无法使用pip安装第三方包
- C++ 11 Lambda表达式