Note that there are some explanatory texts on larger screens.

plurals
  1. PObmi app crashes when calculate button pressed
    primarykey
    data
    text
    <p>I'm a android beginner (my first post) and get a crash on running this bmi calculator tutorial: <a href="http://android-meda.blogspot.co.uk/2012/01/writing-your-first-android-app-body.html?m=1" rel="nofollow">http://android-meda.blogspot.co.uk/2012/01/writing-your-first-android-app-body.html?m=1</a> </p> <p>Launched on my phone, the screen goes black with the message "BMI has stopped unfortunately". I'm not sure where to diagnose the problem so any help would be much appreciated. Thank you</p> <pre><code>04-04 14:14:44.750: E/SensorManager(24999): thread start 04-04 14:14:44.755: D/SensorManager(24999): registerListener :: handle = 0 name= LSM330DLC 3-axis Accelerometer delay= 200000 Listener= android.view.OrientationEventListener$SensorEventListenerImpl@42b75490 04-04 14:14:44.760: D/SensorManager(24999): unregisterListener:: Listener= android.view.OrientationEventListener$SensorEventListenerImpl@42b75490 04-04 14:14:44.760: D/Sensors(24999): Remain listener = Sending .. normal delay 200ms 04-04 14:14:44.760: I/Sensors(24999): sendDelay --- 200000000 04-04 14:14:44.765: D/SensorManager(24999): JNI - sendDelay 04-04 14:14:44.765: I/SensorManager(24999): Set normal delay = true 04-04 14:14:44.815: D/SensorManager(24999): registerListener :: handle = 0 name= LSM330DLC 3-axis Accelerometer delay= 200000 Listener= android.view.OrientationEventListener$SensorEventListenerImpl@42b75490 04-04 14:14:44.870: D/libEGL(24999): loaded /system/lib/egl/libEGL_mali.so 04-04 14:14:44.875: D/libEGL(24999): loaded /system/lib/egl/libGLESv1_CM_mali.so 04-04 14:14:44.880: D/libEGL(24999): loaded /system/lib/egl/libGLESv2_mali.so 04-04 14:14:44.885: D/(24999): Device driver API match 04-04 14:14:44.885: D/(24999): Device driver API version: 10 04-04 14:14:44.885: D/(24999): User space API version: 10 04-04 14:14:44.885: D/(24999): mali: REVISION=Linux-r2p4-02rel0 BUILD_DATE=Tue Oct 16 15:37:13 KST 2012 04-04 14:14:44.910: D/OpenGLRenderer(24999): Enabling debug mode 0 04-04 14:14:44.985: W/IInputConnectionWrapper(24999): showStatusIcon on inactive InputConnection 04-04 14:14:52.235: D/SensorManager(24999): unregisterListener:: Listener= android.view.OrientationEventListener$SensorEventListenerImpl@42b75490 04-04 14:14:52.235: D/Sensors(24999): Remain listener = Sending .. normal delay 200ms 04-04 14:14:52.235: I/Sensors(24999): sendDelay --- 200000000 04-04 14:14:52.235: D/SensorManager(24999): JNI - sendDelay 04-04 14:14:52.235: I/SensorManager(24999): Set normal delay = true 04-04 14:14:52.240: D/SensorManager(24999): registerListener :: handle = 0 name= LSM330DLC 3-axis Accelerometer delay= 200000 Listener= android.view.OrientationEventListener$SensorEventListenerImpl@42b78da8 04-04 14:14:52.260: W/IInputConnectionWrapper(24999): getSelectedText on inactive InputConnection 04-04 14:14:52.265: W/IInputConnectionWrapper(24999): setComposingText on inactive InputConnection 04-04 14:14:52.265: W/IInputConnectionWrapper(24999): getExtractedText on inactive InputConnection 04-04 14:14:53.420: D/AndroidRuntime(24999): Shutting down VM 04-04 14:14:53.420: W/dalvikvm(24999): threadid=1: thread exiting with uncaught exception (group=0x41f052a0) 04-04 14:14:53.430: E/AndroidRuntime(24999): FATAL EXCEPTION: main 04-04 14:14:53.430: E/AndroidRuntime(24999): java.lang.IllegalStateException: Could not execute method of the activity 04-04 14:14:53.430: E/AndroidRuntime(24999): at android.view.View$1.onClick(View.java:3691) 04-04 14:14:53.430: E/AndroidRuntime(24999): at android.view.View.performClick(View.java:4211) 04-04 14:14:53.430: E/AndroidRuntime(24999): at android.view.View$PerformClick.run(View.java:17267) 04-04 14:14:53.430: E/AndroidRuntime(24999): at android.os.Handler.handleCallback(Handler.java:615) 04-04 14:14:53.430: E/AndroidRuntime(24999): at android.os.Handler.dispatchMessage(Handler.java:92) 04-04 14:14:53.430: E/AndroidRuntime(24999): at android.os.Looper.loop(Looper.java:137) 04-04 14:14:53.430: E/AndroidRuntime(24999): at android.app.ActivityThread.main(ActivityThread.java:4898) 04-04 14:14:53.430: E/AndroidRuntime(24999): at java.lang.reflect.Method.invokeNative(Native Method) 04-04 14:14:53.430: E/AndroidRuntime(24999): at java.lang.reflect.Method.invoke(Method.java:511) 04-04 14:14:53.430: E/AndroidRuntime(24999): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006) 04-04 14:14:53.430: E/AndroidRuntime(24999): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773) 04-04 14:14:53.430: E/AndroidRuntime(24999): at dalvik.system.NativeStart.main(Native Method) 04-04 14:14:53.430: E/AndroidRuntime(24999): Caused by: java.lang.reflect.InvocationTargetException 04-04 14:14:53.430: E/AndroidRuntime(24999): at java.lang.reflect.Method.invokeNative(Native Method) 04-04 14:14:53.430: E/AndroidRuntime(24999): at java.lang.reflect.Method.invoke(Method.java:511) 04-04 14:14:53.430: E/AndroidRuntime(24999): at android.view.View$1.onClick(View.java:3686) 04-04 14:14:53.430: E/AndroidRuntime(24999): ... 11 more 04-04 14:14:53.430: E/AndroidRuntime(24999): Caused by: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText 04-04 14:14:53.430: E/AndroidRuntime(24999): at com.example.bmi.MainActivity.calculateClickHandler(MainActivity.java:22) 04-04 14:14:53.430: E/AndroidRuntime(24999): ... 14 more </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload