How can I debug this NullPointer exception?

后端 未结 7 1638
南方客
南方客 2020-12-28 19:49

I\'m trying to write an application for Android and when I launch my new activity, I\'ve set break points and found that it runs through my onCreate without any errors, but

7条回答
  •  一整个雨季
    2020-12-28 19:55

    Your assumption should be the NPE is caused by you, not Android. The NPE may pop at ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord) line: 2268, but that means you passed a null pointer to something and it kept on getting passed around until performLaunchActivity actually tried using it and crashed when it found a null pointer.

    If we can see the full LogCat, particularly everything in red in the Eclipse LogCat it would help for debugging. I've turned myself inside out looking for an NPE only for someone else to find a very subtle resource initializing line out of place.

提交回复
热议问题