Stop / Pause An Iterator
I am trying to implement an animation of Markers on a Google Map. The issue I am running into is an Animation being started while another Animation is still happening for a specifi
Solution 1:
Just use a while loop to stop your iterator logic.
while (iterator.hasNext()) {
// waitwhile (!someBooleanConditionToWaitFor) { }
// do your other stuff// when you're done your other stuff, set it back to false.
someBooleanConditionToWaitFor = false;
}
When your animation has finished, set the condition to true so that it continues. When you're at the end of that iteration, set it back to false so it waits again.
Post a Comment for "Stop / Pause An Iterator"