<pre name="code" class="java">private void setAnimListener(AnimationDrawable animDance,final AnimListener mAnimListener){
int duration = 0;
for(int i=0;i<animDance.getNumberOfFrames();i++){
duration += animDance.getDuration(i);
}
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
mAnimListener.AnimationStop();
}
}, duration);
}
private interface AnimListener {
<span style="white-space:pre"> </span>public void AnimationStop();
};