问题描述
- Eclipse运行安卓程序自动停止
- 运行helllo world 什么的就没事, 按照教程打的代码,运行这种有按钮的一点击确定就自动退出,第一次问问题求大神解答一下。
Console:
[2016-05-22 18:04:04 - QQ] ------------------------------
[2016-05-22 18:04:04 - QQ] Android Launch!
[2016-05-22 18:04:04 - QQ] adb is running normally.
[2016-05-22 18:04:04 - QQ] Performing cn.itcast.qq.MainActivity activity launch
[2016-05-22 18:04:04 - QQ] Automatic Target Mode: using device 'emulator-5554'
[2016-05-22 18:04:04 - QQ] Application already deployed. No need to reinstall.
[2016-05-22 18:04:04 - QQ] Starting activity cn.itcast.qq.MainActivity on device emulator-5554
[2016-05-22 18:04:04 - QQ] ActivityManager: WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
[2016-05-22 18:04:04 - QQ] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=cn.itcast.qq/.MainActivity }
Logcat:
05-22 06:03:05.048: D/AndroidRuntime(4282): Shutting down VM
05-22 06:03:05.048: W/dalvikvm(4282): threadid=1: thread exiting with uncaught exception (group=0xb3cb2b20)
05-22 06:03:05.048: E/AndroidRuntime(4282): FATAL EXCEPTION: main
05-22 06:03:05.048: E/AndroidRuntime(4282): Process: cn.itcast.qq PID: 4282
05-22 06:03:05.048: E/AndroidRuntime(4282): java.lang.IllegalStateException: Could not find a method Login(View) in the activity class cn.itcast.qq.MainActivity for onClick handler on view class android.widget.Button
05-22 06:03:05.048: E/AndroidRuntime(4282): at android.view.View$1.onClick(View.java:3810)
05-22 06:03:05.048: E/AndroidRuntime(4282): at android.view.View.performClick(View.java:4438)
05-22 06:03:05.048: E/AndroidRuntime(4282): at android.view.View$PerformClick.run(View.java:18422)
05-22 06:03:05.048: E/AndroidRuntime(4282): at android.os.Handler.handleCallback(Handler.java:733)
05-22 06:03:05.048: E/AndroidRuntime(4282): at android.os.Handler.dispatchMessage(Handler.java:95)
05-22 06:03:05.048: E/AndroidRuntime(4282): at android.os.Looper.loop(Looper.java:136)
05-22 06:03:05.048: E/AndroidRuntime(4282): at android.app.ActivityThread.main(ActivityThread.java:5017)
05-22 06:03:05.048: E/AndroidRuntime(4282): at java.lang.reflect.Method.invokeNative(Native Method)
05-22 06:03:05.048: E/AndroidRuntime(4282): at java.lang.reflect.Method.invoke(Method.java:515)
05-22 06:03:05.048: E/AndroidRuntime(4282): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
05-22 06:03:05.048: E/AndroidRuntime(4282): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
05-22 06:03:05.048: E/AndroidRuntime(4282): at dalvik.system.NativeStart.main(Native Method)
05-22 06:03:05.048: E/AndroidRuntime(4282): Caused by: java.lang.NoSuchMethodException: Login [class android.view.View]
05-22 06:03:05.048: E/AndroidRuntime(4282): at java.lang.Class.getConstructorOrMethod(Class.java:472)
05-22 06:03:05.048: E/AndroidRuntime(4282): at java.lang.Class.getMethod(Class.java:857)
05-22 06:03:05.048: E/AndroidRuntime(4282): at android.view.View$1.onClick(View.java:3803)
05-22 06:03:05.048: E/AndroidRuntime(4282): ... 11 more
05-22 06:03:53.328: D/gralloc_ranchu(4395): Emulator without host-side GPU emulation detected.
05-22 06:03:56.048: D/AndroidRuntime(4395): Shutting down VM
05-22 06:03:56.048: W/dalvikvm(4395): threadid=1: thread exiting with uncaught exception (group=0xb3cb2b20)
05-22 06:03:56.048: E/AndroidRuntime(4395): FATAL EXCEPTION: main
05-22 06:03:56.048: E/AndroidRuntime(4395): Process: cn.itcast.qq PID: 4395
05-22 06:03:56.048: E/AndroidRuntime(4395): java.lang.IllegalStateException: Could not find a method Login(View) in the activity class cn.itcast.qq.MainActivity for onClick handler on view class android.widget.Button
05-22 06:03:56.048: E/AndroidRuntime(4395): at android.view.View$1.onClick(View.java:3810)
05-22 06:03:56.048: E/AndroidRuntime(4395): at android.view.View.performClick(View.java:4438)
05-22 06:03:56.048: E/AndroidRuntime(4395): at android.view.View$PerformClick.run(View.java:18422)
05-22 06:03:56.048: E/AndroidRuntime(4395): at android.os.Handler.handleCallback(Handler.java:733)
05-22 06:03:56.048: E/AndroidRuntime(4395): at android.os.Handler.dispatchMessage(Handler.java:95)
05-22 06:03:56.048: E/AndroidRuntime(4395): at android.os.Looper.loop(Looper.java:136)
05-22 06:03:56.048: E/AndroidRuntime(4395): at android.app.ActivityThread.main(ActivityThread.java:5017)
05-22 06:03:56.048: E/AndroidRuntime(4395): at java.lang.reflect.Method.invokeNative(Native Method)
05-22 06:03:56.048: E/AndroidRuntime(4395): at java.lang.reflect.Method.invoke(Method.java:515)
05-22 06:03:56.048: E/AndroidRuntime(4395): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
05-22 06:03:56.048: E/AndroidRuntime(4395): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
05-22 06:03:56.048: E/AndroidRuntime(4395): at dalvik.system.NativeStart.main(Native Method)
05-22 06:03:56.048: E/AndroidRuntime(4395): Caused by: java.lang.NoSuchMethodException: Login [class android.view.View]
05-22 06:03:56.048: E/AndroidRuntime(4395): at java.lang.Class.getConstructorOrMethod(Class.java:472)
05-22 06:03:56.048: E/AndroidRuntime(4395): at java.lang.Class.getMethod(Class.java:857)
05-22 06:03:56.048: E/AndroidRuntime(4395): at android.view.View$1.onClick(View.java:3803)
05-22 06:03:56.048: E/AndroidRuntime(4395): ... 11 more
05-22 06:06:21.188: D/gralloc_ranchu(4674): Emulator without host-side GPU emulation detected.
05-22 06:06:22.788: W/IInputConnectionWrapper(4674): showStatusIcon on inactive InputConnection
解决方案
java.lang.IllegalStateException: Could not find a method Login(View) in the activity class cn.itcast.qq.MainActivity for onClick handler on view class android.widget.Button
这个是你的报错,说你在cn.itcast.qq.MainActivity没有定义Login(View)方法
解决方案二:
java.lang.IllegalStateException: Could not find a method Login(View) in the activity class cn.itcast.qq.MainActivity for onClick handler on view class android.widget.Button
这个是你的报错,说你在cn.itcast.qq.MainActivity没有定义Login(View)方法
解决方案三:
Eclipse下运行hadoop自带的mapreduce程序--wordcount
时间: 2024-08-18 05:30:04