0

I'm using listItems array which contains checkboxes every checked item is saved in mUserItems array I want to print every checked item separated in mItemSeleced textView for 3 seconds using a countdown timer then delete it and get the other item for 3 seconds and so on; the problem is after 3 seconds I only get the last item checked

public void onClick(DialogInterface dialogInterface, int which) {
    for (int i = 0; i < mUserItems.size(); i++) {
        final int j = i;
        new CountDownTimer(3000, 1000) {
            public void onTick(long millisUntilFinished) {}
            public void onFinish() {
                mItemSelected.setText("");
                mItemSelected.setText(listItems[mUserItems.get(j)]);
            }
        }.start();
    }
}
phwt
  • 1,356
  • 1
  • 22
  • 42

1 Answers1

0

If you use loop or recursion, try using

delay(3000); after the updating statement (then loop continues)!