This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I'm new in this Forum and I hope you can help me with a little SurfaceView problem.
An external Thread is calling doDraw:
The doDraw() in MySurfaceView
What I see now, is the image in the background and a line. But if the configuration of the line changes, i don't see the line "moving". There now is a line for every call of doDraw().
I found this in the DevGuide:
On each pass you retrieve the Canvas from the SurfaceHolder, the previous state of the Canvas will be retained. In order to properly animate your graphics, you must re-paint the entire surface. For example, you can clear the previous state of the Canvas by filling in a color with drawColor() or setting a background image with drawBitmap(). Otherwise, you will see traces of the drawings you previously performed.
But I have a background Image and it doesnt help.
So I tried
I even tried to draw a rectangle:
But it's not working.
And now I need your help ;)
Joined: Mar 03, 2011
I dont know why i use Path().
I have to use drawLine() instead.