-1
Comment puis-je utiliser une variable dans un gestionnaire d'animationUtiliser la variable dans Animationlistener
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);
}
}); }
erreur Eclipse: ne peut pas se référer à une variable non finale dans une classe interne définie dans une autre méthode
(se référant à i)