Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to properly debug Java (Android) using Eclipse?

I am having problems with debugging my code. One of my AsyncTasks throws a RuntimeException, but I don't know which line in my code is responsible for this. Since I am new to Eclipse and Java in general, all of this is rather confusing to me.

Eclipse's debugging window shows me that my AsyncTask has been suspended because of a RuntimeException. Below that, there are three lines which point out certain lines of code. However, those lines do not exist in my code which is why I do not know what causes my application to crash. Am I missing something essential about debugging in Java / Android?

These are the three lines which I am given, by the way:

ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) line: 1086  
ThreadPoolExecutor$Worker.run() line: 561   
Thread.run() line: 1096 

How am I supposed to work with that? Help would be greatly appreciated.

like image 451
Tim Avatar asked Nov 04 '22 15:11

Tim


1 Answers

in the ddms you can get the message related to the error, warning or other type of messages into the logcat window if you can't able to find the logcat in the ddms then go to the menu Window->Show View->logcat click on that and you'll be able to see the message now in the same ddms you also get the device window from that select the device for you can able to debug or get the message from that device into the logcat.

now check this way you can find your error detail into this logcat details

like image 101
Pratik Avatar answered Nov 09 '22 12:11

Pratik