是否有某些原因让我无法在动画侦听器中提供的Animator上调用.cancel()?为什么在动画侦听器中调用.cancel()会导致StackOverflowError?
当我执行下面的代码我得到的StackOverflowError:
animation.addListener(new ValueAnimator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
if (!showCircles)
animator.cancel();
}
....
如果你调用'animation.cancel()'会发生什么? – tolgap
'动画'不能从内部类中调用(除非它被声明为final)。 – gsysko