for (int i=0; i<HisXArray.size(); i++) {
ycoord2 = HisYArray.get(i);
major2 = HisMajorArray.get(i);
xcoord2 = HisXArray.get(i);
minor2 = HisMinorArray.get(i);
time3 = TimeArray.get(i);
timer = new CountDownTimer(time3, 1000) {
@Override
public void onFinish() {
Log.e("Timer", xcoord2 + " " + ycoord2 + " " + time3);
mView.mFadePaint.setColor(Color.BLACK);
mView.drawOval(mView.mCanvas, xcoord2, ycoord2, 2*major2, 2*minor2, mView.mFadePaint);
mView.invalidate();
}
@Override
public void onTick(long millisUntilFinished) {
// TODO Auto-generated method stub
}
}.start();
当我尝试使用计时器绘制内容时,onFinish仅在time3 = 0且i = HisXArray.size() - 1时调用,即最后一次。