I have a list of hexadecimal colors with duration in milliseconds for each of them. I would like to fill the screen with each color for its duration, and then move on to the next color.
I tried iterating over colors to do the following:
myView.setBackgroundColor(Color.parseColor( theColor ));
SystemClock.sleep( theDuration );
myView.setBackgroundColor(Color.parseColor( nextColor ));
SystemClock.sleep( nextDuration );
etc...
which seemed obvious to me, but does nothing to represent when it works, at least in my AVD. I study this because Android only works at predefined times. (I have not tried calling "Invalidate ()").
What is the best way to display all colors sequentially?
(I understand that I should not call sleep () either, so any suggestions for this will also be appreciated.)
Thanks.