On Nov 3, 12:23 am, joshbeck <[EMAIL PROTECTED]> wrote: > Ok, this keeps the background and draws a circle on top of it when I > touch the screen. > Question: How do you think I might get it to keep the old circles when > I draw new ones. > Right now when I click the canvas is completely redrawn and the first > circle I created is lost.
You are losing the old circles because (I assume) you are clearing the screen when you draw the mBitmap. However, that is a pretty normal thing to do in your onDraw. If you want to draw the previous circles you need to remember their coordinates in some kind of data structure and then iterate over that structure and draw all the circles. Have a look here: http://java.sun.com/docs/books/tutorial/collections/intro/index.html for some details about collections in Java. Something like ArrayList will work for you and be easy to implement. If you move to this approach then in the onDraw you add a new object (maybe a Point) to the ArrayList and then in the onDraw iterate over your ArrayList and draw all the circles. In this case you won't need your ZZ flag any more but for future reference a boolean would have been a better data type for your flag. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

