You are applying the supplied AnimationListener to animation. However, you replace animation on every expand() and collapse() call, and the new Animation does not have the listener. Either don't keep replacing animation, or hold onto the AnimationListener and apply it to each new Animation that you create.
You are applying the supplied
AnimationListenertoanimation. However, you replaceanimationon everyexpand()andcollapse()call, and the newAnimationdoes not have the listener. Either don't keep replacinganimation, or hold onto theAnimationListenerand apply it to each newAnimationthat you create.