Android 的 log报错问题08-28 01:48:53.306:D/dalvikvm(540):Not late-enabling CheckJNI (already on)08-28 01:48:54.557:D/AndroidRuntime(540):Shutting down VM08-28 01:48:54.566:W/dalvikvm(540):threadid=1:thread exiting with uncaught exception (group=
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 07:56:18
Android 的 log报错问题08-28 01:48:53.306:D/dalvikvm(540):Not late-enabling CheckJNI (already on)08-28 01:48:54.557:D/AndroidRuntime(540):Shutting down VM08-28 01:48:54.566:W/dalvikvm(540):threadid=1:thread exiting with uncaught exception (group=
Android 的 log报错问题
08-28 01:48:53.306:D/dalvikvm(540):Not late-enabling CheckJNI (already on)
08-28 01:48:54.557:D/AndroidRuntime(540):Shutting down VM
08-28 01:48:54.566:W/dalvikvm(540):threadid=1:thread exiting with uncaught exception (group=0x409961f8)
08-28 01:48:54.576:E/AndroidRuntime(540):FATAL EXCEPTION:main
08-28 01:48:54.576:E/AndroidRuntime(540):java.lang.RuntimeException:Unable to start activity ComponentInfo{com.example.activity02/com.example.activity02.MainActivity}:java.lang.ClassCastException:com.example.activity02.MainActivity$MyButtonListener cannot be cast to android.view.View$OnClickListener
08-28 01:48:54.576:E/AndroidRuntime(540):at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1955)
08-28 01:48:54.576:E/AndroidRuntime(540):at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
08-28 01:48:54.576:E/AndroidRuntime(540):at android.app.ActivityThread.access$600(ActivityThread.java:122)
08-28 01:48:54.576:E/AndroidRuntime(540):at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
08-28 01:48:54.576:E/AndroidRuntime(540):at android.os.Handler.dispatchMessage(Handler.java:99)
08-28 01:48:54.576:E/AndroidRuntime(540):at android.os.Looper.loop(Looper.java:137)
08-28 01:48:54.576:E/AndroidRuntime(540):at android.app.ActivityThread.main(ActivityThread.java:4340)
08-28 01:48:54.576:E/AndroidRuntime(540):at java.lang.reflect.Method.invokeNative(Native Method)
08-28 01:48:54.576:E/AndroidRuntime(540):at java.lang.reflect.Method.invoke(Method.java:511)
08-28 01:48:54.576:E/AndroidRuntime(540):at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
08-28 01:48:54.576:E/AndroidRuntime(540):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
08-28 01:48:54.576:E/AndroidRuntime(540):at dalvik.system.NativeStart.main(Native Method)
08-28 01:48:54.576:E/AndroidRuntime(540):Caused by:java.lang.ClassCastException:com.example.activity02.MainActivity$MyButtonListener cannot be cast to android.view.View$OnClickListener
08-28 01:48:54.576:E/AndroidRuntime(540):at com.example.activity02.MainActivity.onCreate(MainActivity.java:21)
08-28 01:48:54.576:E/AndroidRuntime(540):at android.app.Activity.performCreate(Activity.java:4465)
08-28 01:48:54.576:E/AndroidRuntime(540):at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
08-28 01:48:54.576:E/AndroidRuntime(540):at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
08-28 01:48:54.576:E/AndroidRuntime(540):...11 more
08-28 01:49:14.708:I/Process(540):Sending signal.PID:540 SIG:9
运行虚拟机之后就stop running了.
Android 的 log报错问题08-28 01:48:53.306:D/dalvikvm(540):Not late-enabling CheckJNI (already on)08-28 01:48:54.557:D/AndroidRuntime(540):Shutting down VM08-28 01:48:54.566:W/dalvikvm(540):threadid=1:thread exiting with uncaught exception (group=
你从下面往上找这个关键词 Caused by:然后看看什么原因,再往上找.
还有FATAL EXCEPTION:看看后面写了什么.
你这是不能实例你Activity中的这个MyButtonListener对象,然后你再看看代码,就差不多知道什么问题了