Android 报错看不懂
10-10 08:40:42.089: E/AndroidRuntime(817): FATAL EXCEPTION: main
10-10 08:40:42.089: E/AndroidRuntime(817): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.demo_test/com.example.demo_test.MainActivity}: java.lang.ClassCastException: android.widget.ImageButton cannot be cast to android.widget.Button
10-10 08:40:42.089: E/AndroidRuntime(817): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
10-10 08:40:42.089: E/AndroidRuntime(817): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
10-10 08:40:42.089: E/AndroidRuntime(817): at android.app.ActivityThread.access$600(ActivityThread.java:123)
10-10 08:40:42.089: E/AndroidRuntime(817): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
10-10 08:40:42.089: E/AndroidRuntime(817): at android.os.Handler.dispatchMessage(Handler.java:99)
10-10 08:40:42.089: E/AndroidRuntime(817): at android.os.Looper.loop(Looper.java:137)
10-10 08:40:42.089: E/AndroidRuntime(817): at android.app.ActivityThread.main(ActivityThread.java:4424)
10-10 08:40:42.089: E/AndroidRuntime(817): at java.lang.reflect.Method.invokeNative(Native Method)
10-10 08:40:42.089: E/AndroidRuntime(817): at java.lang.reflect.Method.invoke(Method.java:511)
10-10 08:40:42.089: E/AndroidRuntime(817): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
10-10 08:40:42.089: E/AndroidRuntime(817): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
10-10 08:40:42.089: E/AndroidRuntime(817): at dalvik.system.NativeStart.main(Native Method)
10-10 08:40:42.089: E/AndroidRuntime(817): Caused by: java.lang.ClassCastException: android.widget.ImageButton cannot be cast to android.widget.Button
10-10 08:40:42.089: E/AndroidRuntime(817): at com.example.demo_test.MainActivity.onCreate(MainActivity.java:27)
10-10 08:40:42.089: E/AndroidRuntime(817): at android.app.Activity.performCreate(Activity.java:4466)
10-10 08:40:42.089: E/AndroidRuntime(817): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
10-10 08:40:42.089: E/AndroidRuntime(817): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
10-10 08:40:42.089: E/AndroidRuntime(817): ... 11 more