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);
  3. canvas.drawRect(mTargetRect, mLinePaint);
Parsed in 0.014 seconds, using GeSHi

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.010 seconds, using GeSHi

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?
Junior Developer
Junior Developer
Posts: 17
Joined: Fri Oct 16, 2009 8:48 pm


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

eclipse - debug - mode - logcat

your (solved)error will be logged as a NullPointerException

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


Return to Other Coding-Problems

Who is online

Users browsing this forum: Exabot [Bot] and 3 guests