先贴上日志,启动时直接报错,当时就有点蒙,仔细分析日志才发现是XML的一个组件名字有问题,发现编程跟测试一样,一旦出现问题,要善于寻找蛛丝马迹。
UP一个。
02-05 05:32:41.983: W/dalvikvm(515): threadid=1: thread exiting with uncaught exception (group=0x40014760)
02-05 05:32:42.833: E/AndroidRuntime(515): FATAL EXCEPTION: main02-05 05:32:42.833: E/AndroidRuntime(515): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.dou/com.android.dou.event_test}: android.view.InflateException: Binary XML file line #18: Error inflating class EditView
02-05 05:32:42.833: E/AndroidRuntime(515): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1815)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.app.ActivityThread.access$500(ActivityThread.java:122)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.os.Handler.dispatchMessage(Handler.java:99)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.os.Looper.loop(Looper.java:132)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.app.ActivityThread.main(ActivityThread.java:4123)
02-05 05:32:42.833: E/AndroidRuntime(515): at java.lang.reflect.Method.invokeNative(Native Method)
02-05 05:32:42.833: E/AndroidRuntime(515): at java.lang.reflect.Method.invoke(Method.java:491)
02-05 05:32:42.833: E/AndroidRuntime(515): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
02-05 05:32:42.833: E/AndroidRuntime(515): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
02-05 05:32:42.833: E/AndroidRuntime(515): at dalvik.system.NativeStart.main(Native Method)
02-05 05:32:42.833: E/AndroidRuntime(515): Caused by: android.view.InflateException: Binary XML file line #18: Error inflating class EditView
02-05 05:32:42.833: E/AndroidRuntime(515): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:682)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.view.LayoutInflater.rInflate(LayoutInflater.java:724)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.view.LayoutInflater.inflate(LayoutInflater.java:391)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.view.LayoutInflater.inflate(LayoutInflater.java:347)
02-05 05:32:42.833: E/AndroidRuntime(515): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:223)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.app.Activity.setContentView(Activity.java:1786)
02-05 05:32:42.833: E/AndroidRuntime(515): at com.android.dou.event_test.onCreate(event_test.java:27)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.app.Activity.performCreate(Activity.java:4397)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1779)
02-05 05:32:42.833: E/AndroidRuntime(515): ... 11 more
02-05 05:32:42.833: E/AndroidRuntime(515): Caused by: java.lang.ClassNotFoundException: android.view.EditView in loader dalvik.system.PathClassLoader[/data/app/com.android.dou-2.apk]
02-05 05:32:42.833: E/AndroidRuntime(515): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:251)
02-05 05:32:42.833: E/AndroidRuntime(515): at java.lang.ClassLoader.loadClass(ClassLoader.java:540)
02-05 05:32:42.833: E/AndroidRuntime(515): at java.lang.ClassLoader.loadClass(ClassLoader.java:500)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.view.LayoutInflater.createView(LayoutInflater.java:542)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:627)
02-05 05:32:42.833: E/AndroidRuntime(515): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:644)
02-05 05:32:42.833: E/AndroidRuntime(515): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669)
02-05 05:32:42.833: E/AndroidRuntime(515): ... 23 more
02-05 05:32:46.673: I/Process(515): Sending signal. PID: 515 SIG: 9