Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Nidhi Saini
2,627 Pointsbuild-a-selfdestructing-message-android-app: Error Messages and Dialogs
I am not sure how to fix this error. I am using parser 1.4.1 jar file. Help me fix this issue.
02-26 14:00:26.288: V/Provider/Settings(19215): from settings cache , name = sound_effects_enabled , value = 0 02-26 14:00:26.288: D/AndroidRuntime(19215): Shutting down VM 02-26 14:00:26.289: W/dalvikvm(19215): threadid=1: thread exiting with uncaught exception (group=0x414589a8) 02-26 14:00:26.295: E/AndroidRuntime(19215): FATAL EXCEPTION: main 02-26 14:00:26.295: E/AndroidRuntime(19215): java.lang.NullPointerException 02-26 14:00:26.295: E/AndroidRuntime(19215): at com.turtalabs.bagit.SignUpActivity$1.onClick(SignUpActivity.java:32) 02-26 14:00:26.295: E/AndroidRuntime(19215): at android.view.View.performClick(View.java:4243) 02-26 14:00:26.295: E/AndroidRuntime(19215): at android.view.View$PerformClick.run(View.java:17520) 02-26 14:00:26.295: E/AndroidRuntime(19215): at android.os.Handler.handleCallback(Handler.java:725) 02-26 14:00:26.295: E/AndroidRuntime(19215): at android.os.Handler.dispatchMessage(Handler.java:92) 02-26 14:00:26.295: E/AndroidRuntime(19215): at android.os.Looper.loop(Looper.java:153) 02-26 14:00:26.295: E/AndroidRuntime(19215): at android.app.ActivityThread.main(ActivityThread.java:5297) 02-26 14:00:26.295: E/AndroidRuntime(19215): at java.lang.reflect.Method.invokeNative(Native Method) 02-26 14:00:26.295: E/AndroidRuntime(19215): at java.lang.reflect.Method.invoke(Method.java:511) 02-26 14:00:26.295: E/AndroidRuntime(19215): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833) 02-26 14:00:26.295: E/AndroidRuntime(19215): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) 02-26 14:00:26.295: E/AndroidRuntime(19215): at dalvik.system.NativeStart.main(Native Method)
1 Answer
Nidhi Saini
2,627 PointsThis ## mUsername = (EditText)findViewById(R.id.usenameField); Should be ## mUsername = (EditText)findViewById(R.id.usernameField); I am not able to update my R.java file. It still have usenameField and usernameField string.
Nidhi Saini
2,627 PointsNidhi Saini
2,627 PointsCode for SignUpActivity.class and activity_sign_up.xml file SignUpActivity.class
import android.app.Activity; import android.app.AlertDialog; import android.os.Bundle; import android.view.Menu; import android.view.View; import android.widget.Button; import android.widget.EditText;
public class SignUpActivity extends Activity {
}
** activity_sign_up.xml**
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".SignUpActivity" >
</RelativeLayout>