If you are in the debugger, either at a breakpoint or having stepped
over some code that justs threw an exception, I have yet to see a case
where, after stepping through using the Step Over button, you don't
eventually come to a frame that has the exception in it.

You can then use the Display window to do ex.printStackTrace(). The
stack trace will indicate where. You can actually click on the
displayed stacktrace in the console to take you to the source, if it's
available!

You can do the ex.printStackTrace() in the catch clause of your
debugging try/catch statement, too -- but the above technique avoids
the need to modify and re-run your code.

But it's better to catch it in the act. In the Breakpoints pane, click
on the Exceptions Breakpoint icon (it looks like an exclamation
point). Enter your selection -- or even Exception if you want to see
every single one. Of course, then you have to re-run your code. Except
sometimes you can re-execute a higher-level frame, and not restart.
Just be aware that the code may not do exactly the same thing in that
case, depending on what side-effects the code has already done.

I usually run with an Error breakpoint as well.

On Feb 8, 11:29 pm, RustedInSeattle <guoxiaot...@gmail.com> wrote:
> Hi all,
>       I am pretty new to Android, the thing that bugs me the most
> about the IDE is that I am not able to get any information about an
> unexpected exception when it gets thrown, I can put a try catch block
> around identified code that generates it, but in many cases it takes
> time to find the line of code that generates the exception. is there
> any other way I can get the exception information?  in JDT when an
> unexpected exception is thrown the call stack displays the exception
> class name. but in ADT this doesn't work.
>      Thanks in advance!
>
> -Xiaotian

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to