I used the android.animation.AnimatorListenerAdapter class in my code to listen to animations. Example :
downView.animate().translationX(-mViewWidth).setDuration(mAnimationTime).
setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(
Animator animation) {
boolean real_dismiss = true;
performDismiss(
//some code
)
}
I used the backward compatibility lib by nineoldandroids, the animations work fine, but i am getting the following error, that does not let me run my code, at my listener:
The method setListener(Animator.AnimatorListener) in the type ViewPropertyAnimator is not applicable for the arguments (new AnimatorListenerAdapter(){})
The code was working fine when I was using the API level 11. My old import statements:
//import android.animation.Animator;
//import android.animation.AnimatorListenerAdapter;
//import android.animation.ValueAnimator;
My new import statement :
import com.nineoldandroids.animation.*;
import com.nineoldandroids.*;