How can i use a variable within an animationlistener
ex.
for(int i = 0; i<ids.length; i++) {
//Doing some animation stuff based on
//imageView = (ImageView) findViewById(ids[i]);
//I want to play a sound on the specific views animationstart
scalePause.addListener(new AnimatorListenerAdapter() {
public void onAnimationStart(Animator animation) {
sounds.play(letterSounds[i], 1.0f, 1.0f, 0, 0, 1.0f);
}
});
}
Eclipse error: Cannot refer to a non final variable inside an inner class defined in a different method
(referring to i)
Do this