android 我新建了个activity 我给他设置主题时,只能设置成这个主题 android:theme="@style/AppTheme",其他的主题都报错03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: FATAL EXCEPTION: main03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{cn.mylife.activityliftcircle/cn.jikexuyuan.com.activityliftcircle.ActB}: android.view.InflateException: Binary XML file line #2: Error inflating class android.support.design.widget.CoordinatorLayout03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread.access$600(ActivityThread.java:141)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.os.Looper.loop(Looper.java:137)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5103)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:525)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.support.design.widget.CoordinatorLayout03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:620)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:469)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:397)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:353)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:267)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.Activity.setContentView(Activity.java:1895)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at cn.jikexuyuan.com.activityliftcircle.ActB.onCreate(ActB.java:16)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:5133)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread.access$600(ActivityThread.java:141) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.os.Looper.loop(Looper.java:137) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5103) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:525) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at java.lang.reflect.Constructor.constructNative(Native Method)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at java.lang.reflect.Constructor.newInstance(Constructor.java:417)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:594)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:469) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:267) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.Activity.setContentView(Activity.java:1895) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at cn.jikexuyuan.com.activityliftcircle.ActB.onCreate(ActB.java:16) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:5133) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread.access$600(ActivityThread.java:141) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.os.Looper.loop(Looper.java:137) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5103) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:525) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: Caused by: java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library.03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.support.design.widget.ThemeUtils.checkAppCompatTheme(ThemeUtils.java:34)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.support.design.widget.CoordinatorLayout.<init>(CoordinatorLayout.java:182)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.support.design.widget.CoordinatorLayout.<init>(CoordinatorLayout.java:176)03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at java.lang.reflect.Constructor.constructNative(Native Method) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:594) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:469) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:267) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.Activity.setContentView(Activity.java:1895) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at cn.jikexuyuan.com.activityliftcircle.ActB.onCreate(ActB.java:16) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.Activity.performCreate(Activity.java:5133) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread.access$600(ActivityThread.java:141) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.os.Looper.loop(Looper.java:137) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5103) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:525) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 03-11 22:20:00.464 31231-31231/cn.mylife.activityliftcircle E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method) 这是错误信息,求大神帮忙
添加回答
举报
0/150
提交
取消