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

Android

Ribbit null pointer error with UserAdapter but can't find offending var! Please Help! Advanced Android topic.

Error as follows:

10-22 18:35:25.973 28742-28742/com.thetechguys.walaka E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.thetechguys.walaka, PID: 28742 java.lang.NullPointerException at com.thetechguys.walaka.adapters.UserAdapter.getView(UserAdapter.java:51) at android.widget.AbsListView.obtainView(AbsListView.java:2743) at android.widget.GridView.onMeasure(GridView.java:1065) at android.view.View.measure(View.java:17486) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:719) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:455) at android.view.View.measure(View.java:17486) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5377) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at android.view.View.measure(View.java:17486) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5377) at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:412) at android.view.View.measure(View.java:17486) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5377) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2548) at android.view.View.measure(View.java:17486) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2287) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1398) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1597) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1256) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6632) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:813) at android.view.Choreographer.doCallbacks(Choreographer.java:613) at android.view.Choreographer.doFrame(Choreographer.java:583) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:799) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:146) at android.app.ActivityThread.main(ActivityThread.java:5598) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099) at dalvik.system.NativeStart.main(Native Method)

UserAdapter code is EXACTLY same as project. Code available here: https://github.com/BecomingPhill/Walaka

Debug stepping in shows no obviously flag-able nulls. Can anyone guess? EditFriends also no obvious typos or errors.

can i see you code

4 Answers

What video are you at?

I've completed the Android track already, I'm making my own modifications to app. But I haven't modified the offending activities that throw the null pointer error.

yeah your a bit ahead of me.