debugging issues using eclipse

Put your problem here if it does not fit any of the other categories.

debugging issues using eclipse

Postby edzillion » Tue Oct 20, 2009 3:20 pm

I had an issue with drawing a rectange to the canvas using drawRect:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. mTargetRect.set(targetX - 1, targetY - 1, targetX + 1, targetY + 1);
  2.  
  3. canvas.drawRect(mTargetRect, mLinePaint);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


I managed to get it working, the problem was that I hadn't initialised the rectangle object:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. mTargetRect = new RectF(0, 0, 0, 0);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


All I got was a force close on the emulator and no other information.
The way I figured this out was to comment out lines, and found the drawRect line was the problem. I then did some research and found that I had to initialise it. Is there a more efficient way to track a problem like this?
edzillion
Junior Developer
Junior Developer
 
Posts: 17
Joined: Fri Oct 16, 2009 8:48 pm

Top

Postby qlimax » Tue Oct 20, 2009 4:55 pm

http://www.anddev.org/the_application_- ... t3452.html

eclipse - debug - mode - logcat



your (solved)error will be logged as a NullPointerException


bye :run:
¯`·.¸¸.><((((º>¯`·.¸¸. ><((((º>
User avatar
qlimax
Master Developer
Master Developer
 
Posts: 271
Joined: Mon Aug 31, 2009 10:54 am
Location: Swiss

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 17 guests