致命异常:主要

时间:2011-11-23 21:36:20

标签: android

我正在开发应用程序,我正在使用裁剪图像的活动,但当我点击按钮切换活动应用程序意外停止... logcat:

11-06 16:34:20.778: ERROR/AndroidRuntime(296): FATAL EXCEPTION: main
11-06 16:34:20.778: ERROR/AndroidRuntime(296): java.lang.IllegalStateException: Could not execute method of the activity
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at android.view.View$1.onClick(View.java:2072)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at android.view.View.performClick(View.java:2408)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at android.view.View$PerformClick.run(View.java:8816)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at android.os.Handler.handleCallback(Handler.java:587)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at android.os.Handler.dispatchMessage(Handler.java:92)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at android.os.Looper.loop(Looper.java:123)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at android.app.ActivityThread.main(ActivityThread.java:4627)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at java.lang.reflect.Method.invokeNative(Native Method)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at java.lang.reflect.Method.invoke(Method.java:521)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at dalvik.system.NativeStart.main(Native Method)
11-06 16:34:20.778: ERROR/AndroidRuntime(296): Caused by: java.lang.reflect.InvocationTargetException
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at project.ubit.menu.Crop_Method(menu.java:52)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at java.lang.reflect.Method.invokeNative(Native Method)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at java.lang.reflect.Method.invoke(Method.java:521)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at android.view.View$1.onClick(View.java:2067)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     ... 11 more
11-06 16:34:20.778: ERROR/AndroidRuntime(296): Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=net.londatiga.android.MainActivity }
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at android.app.Activity.startActivityForResult(Activity.java:2817)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     at android.app.Activity.startActivity(Activity.java:2923)
11-06 16:34:20.778: ERROR/AndroidRuntime(296):     ... 15 more
11-06 16:34:20.859: WARN/ActivityManager(66):   Force finishing activity project.ubit/.menu
11-06 16:34:21.627: WARN/ActivityManager(66): Activity pause timeout for HistoryRecord{450232b0 project.ubit/.menu}
11-06 16:34:21.818: INFO/ARMAssembler(66): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x32c890:0x32c94c] in 1346526 ns
11-06 16:34:25.308: INFO/Process(296): Sending signal. PID: 296 SIG: 9
11-06 16:34:25.428: ERROR/JavaBinder(66): !!! FAILED BINDER TRANSACTION !!!
11-06 16:34:25.428: ERROR/JavaBinder(66): !!! FAILED BINDER TRANSACTION !!!
11-06 16:34:25.518: INFO/ActivityManager(66): Process project.ubit (pid 296) has died.
11-06 16:34:25.518: INFO/WindowManager(66): WIN DEATH: Window{45032fc8 project.ubit/project.ubit.menu paused=false}
11-06 16:34:34.226: WARN/ActivityManager(66): Activity destroy timeout for HistoryRecord{450232b0 project.ubit/.menu}

2 个答案:

答案 0 :(得分:1)

检查你有

public void Crop_Method(View sender) {
...
}

代码。

我认为您拼错了方法名称,因此它与您在XML中onClick中的方法名称不同。

该方法也必须是public

答案 1 :(得分:0)

您正在调用一个名为Crop_Method(View)的方法,该方法未定义。为了给你更多提示,我们需要你的代码。