Animation

hi,
i work on a game in cocos2d-x(android), i play some animation infinite number of times,
but when occur any interrupt animation last frame stuck. so please give me some advice.
how to handle animation when its goes on background and return back to foreground.