Hi All,
I am new to android and trying to animate small image.
I have written below piece of code but during execution i see the the traces of previous drawn images
this method is invoked from another thread:
Do you guys see anything wrong in this ? Any comment will be appreciated.
Unless you are dealing with sprites , you have to erase the first image before painting the second image. If your background is a solid color, to erase an image, repaint the exact same image using the background color. Then paint the new image.
I think you can do it in one thread, call him animatThread, for example : animateUpdate(), animateRender(), paintScreen() methods invoked from thread. All those metods should be in while loop for example:
... animateThread ...
this piece of code is from Java, but I think that, the mechanism will be the same both in Java and Android. Maybe this will help you