-1

When I debug my application I get errors in the LogCat, something like this:

E/AndroidRuntime(27367): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.****/com.****}: java.lang.NullPointerException

Is there a way to know where exactly in the code the exception came from? what was this NULL ?

In many other language when you get this kind of problems it tells you the file and line where it all started

Is there a way of getting it in java and android sdk as well?

kosa
  • 65,990
  • 13
  • 130
  • 167
Yaron U.
  • 7,681
  • 3
  • 31
  • 45

1 Answers1

5

If you look further down the stack trace it will tell you exactly where it occurred by file name and line number. Post the full stack trace if you'd like, but it should be easy to find.

If you have multiple object accessors at that line, either break them out into multiple lines or set a breakpoint and go into debug mode

Rich
  • 36,270
  • 31
  • 115
  • 154