Androidjava.lang.IllegalArgumentException: AppCompat does not support the current theme features

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Androidjava.lang.IllegalArgumentException: AppCompat does not support the current theme features相关的知识,希望对你有一定的参考价值。


作者:程序员小冰 

前段时间看到了一个项目,里面引用了toolbar,androidStudio的项目,类是继承的ActionbarActivity,

看到里面报了一个错误,大概是:

java.lang.IllegalArgumentException: AppCompat does not support the current theme features

具体详细代码是:

java.lang.RuntimeException: Unable to start activity  java.lang.IllegalArgumentException: AppCompat does not support the current theme features
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: AppCompat does not support the current theme features
at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:360)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:246)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106)
at com.grumoon.pulllistview.sample.AppMain.onCreate(AppMain.java:39)
at android.app.Activity.performCreate(Activity.java:5247)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)

最后发现了系统主题没有添加支持。解决方法,在mainfest中所引用的主题style添加:

<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>

然后问题解决。


以上是关于Androidjava.lang.IllegalArgumentException: AppCompat does not support the current theme features的主要内容,如果未能解决你的问题,请参考以下文章