LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
11/09/12 05:07 PM (13 years ago)

After Button Click

I followed David @Buzztouch video on the buttons and onCreate. I created a new screen called Contact..it loaded the home screen then when I click on the Contact screen it crashes and received this in logcat: 11-09 17:57:54.334: E/AndroidRuntime(622): FATAL EXCEPTION: main 11-09 17:57:54.334: E/AndroidRuntime(622): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.johnson/com.johnson.Contact}: java.lang.NullPointerException 11-09 17:57:54.334: E/AndroidRuntime(622): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) 11-09 17:57:54.334: E/AndroidRuntime(622): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 11-09 17:57:54.334: E/AndroidRuntime(622): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 11-09 17:57:54.334: E/AndroidRuntime(622): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 11-09 17:57:54.334: E/AndroidRuntime(622): at android.os.Handler.dispatchMessage(Handler.java:99) 11-09 17:57:54.334: E/AndroidRuntime(622): at android.os.Looper.loop(Looper.java:123) 11-09 17:57:54.334: E/AndroidRuntime(622): at android.app.ActivityThread.main(ActivityThread.java:4627) 11-09 17:57:54.334: E/AndroidRuntime(622): at java.lang.reflect.Method.invokeNative(Native Method) 11-09 17:57:54.334: E/AndroidRuntime(622): at java.lang.reflect.Method.invoke(Method.java:521) 11-09 17:57:54.334: E/AndroidRuntime(622): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 11-09 17:57:54.334: E/AndroidRuntime(622): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 11-09 17:57:54.334: E/AndroidRuntime(622): at dalvik.system.NativeStart.main(Native Method) 11-09 17:57:54.334: E/AndroidRuntime(622): Caused by: java.lang.NullPointerException 11-09 17:57:54.334: E/AndroidRuntime(622): at com.johnson.Contact.onCreate(Contact.java:67) 11-09 17:57:54.334: E/AndroidRuntime(622): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 11-09 17:57:54.334: E/AndroidRuntime(622): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 11-09 17:57:54.334: E/AndroidRuntime(622): ... 11 more Thanks in advance. LA
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
11/09/12 07:11 PM (13 years ago)
This may or may not help, but it's a good little tutorial on nullPointerExceptions. http://stackoverflow.com/questions/218384/what-is-a-null-pointer-exception This are often the hardest to debug. Mark
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
11/10/12 07:08 AM (13 years ago)
Yes very interesting and helpful. Thank you @GoNorthWest. LA
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.