tigerjj / FasterAnimationsContainer

Frame Animation with Drawable without OutOfMemory
84 stars 32 forks source link

Animation not started when displaying for the second time #2

Closed noloman closed 8 years ago

noloman commented 9 years ago

I have a fragment which loads this animation. In the onDestroyView I stop it, but next time I show the fragment, the animation isn't started, nor any drawable shown.

faizhirani commented 9 years ago

Hi Noloman,

I have a 'solution' that 'fixes' the issue that you are having.

Around line 47 there is a single instance constraint. If you remove the if clause, such that every time getInstance is called a new instance is created, the issue of the animation only being rendered on the first load goes away.

public static FasterAnimationsContainer getInstance(ImageView imageView) {
 //   if (sInstance == null)
        sInstance = new FasterAnimationsContainer(imageView);
    return sInstance;
}

The reason I put fixed, and solution in quotes is because I don't know whether this is having the effect of leaving unreleased instances lying around and consuming memory. I assume a memory leak of that type would eventually cause the heap size to increase out of bounds, and the program to crash... but it does seem to 'solve' the animation issue.

Hope that helps.

offset36 commented 9 years ago

Thanks! It has also helped me!

ambalika28p commented 8 years ago

@offset36 could you send me your jar file of the updated fast animation container please ? I'm getting error. Its very urgent.

AbhijitKurane commented 8 years ago

Thanks, It works.