InflateException

时间:2011-09-26 09:49:10

标签: android inflate

我遇到了InflateException错误,我不确定这意味着什么。我希望有人可以向我解释。谢谢。下面是堆栈跟踪。

09-26 17:35:29.747: ERROR/AndroidRuntime(10214): Uncaught handler: thread main exiting due to uncaught exception
09-26 17:35:30.072: ERROR/AndroidRuntime(10214): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.comp.something/com.project.something.something.android.SomethingActivity}: android.view.InflateException: Binary XML file line #15: Error inflating class com.project.something.something.android
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.os.Handler.dispatchMessage(Handler.java:99)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.os.Looper.loop(Looper.java:123)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread.main(ActivityThread.java:4363)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at java.lang.reflect.Method.invokeNative(Native Method)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at java.lang.reflect.Method.invoke(Method.java:521)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at dalvik.system.NativeStart.main(Native Method)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214): Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class com.project.something.something.android
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.Activity.setContentView(Activity.java:1631)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at com.project.something.something.android.SomethingActivity.onCreate(SomethingActivity.java:48)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     ... 11 more
09-26 17:35:30.072: ERROR/AndroidRuntime(10214): Caused by: java.lang.ClassNotFoundException:com.project.something.something.android in loader dalvik.system.PathClassLoader@4803c918
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.createView(LayoutInflater.java:466)
09-26 17:35:30.072: ERROR/AndroidRuntime(10214):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)

1 个答案:

答案 0 :(得分:1)

您似乎想要使用onCreate()setContentView()方法中设置布局。布局引用第5行中名为com.project.something.something.android的类。我猜这个课程不存在,因此布局不会被夸大。