In my Activity I've a Method which must repeat until the user clicks on a button
private void AnimateItem(int i){
((AnimationDrawable) myList.getChildAt(i).getBackground()).start();
}
private void CheckItems(){
int[] items = new int[]{1,3,5};
for(int i = 0; i<items.length(); i++){
AnimateItem(i);
}
}
So, here I'll have:
AnimateItem(1);
AnimateItem(3);
AnimateItem(5);
How to execute methods one by one (when 1st was ended, start 2nd... and repeating cycle after last method end) until button was clicked.