I\'m trying to develop an application for Android, but I\'m having difficulties tracing the source and cause of each exception I get in the process. My code runs in an Activity,
Sounds to me like you should be wrapping your code in question in a try/catch block so you can (A) gracefully handle the exception and (B) Be able to set a breakpoint in the catch block and inspect your variables while debugging. Or am I misunderstanding?
edit:
As an example, if you have an Activity and you're in your onCreate (my Android-fu is a little rusty) and it's
public void onCreate(Bundle blahblah) {
My code here
}
you would instead do
public void onCreate(Bundle blahblah) {
try {
My code here
} catch (Exception e) {
Log.d(Do something to print your stacktrace here); <-- Set your breakpoint here
}
}