Hi, I'm creating a simple application and I want to make a light blink, so I added the following code:
private void flashLight() {
anim = animate(imgLight).setDuration(speeds[speed]);
anim.alpha(0f).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
anim.alpha(1f).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
flashLight();
}
});
}
});
}
The code works perfectly on android devices api 11 or more, but in the versions below it does not work, and animation only runs once. I would like someone to help me with my problem.
Note: I'm using the NineOldAndroids library
Thanks in advance.