Crash when calling doneLoagingAnimation before start animation ends
See original GitHub issueWhen calling doneLoagingAnimation
after startAnimation()
, but before the start animation has ended, the application crashes on a nullpointer:
Attempt to invoke virtual method
'void br.com.simplepass.loading_button_lib.animatedDrawables.CircularAnimatedDrawable.stop()' on a null object reference at
br.com.simplepass.loading_button_lib.customViews.CircularProgressButton.doneLoagingAnimation(CircularProgressButton.java:228)
As said, it happens in the following situation:
- The button starts animating using
startAnimation()
- The loading animation is stopped using
doneLoagingAnimation(params)
before the initial start animation has ended (button getting narrower)
In my case I’m running an async task that finishes really quick. Because the button depends on its own start animation, this might be an issue that can arise anytime; especially when using wide buttons on tablet and devices get faster in the future.
Another tiny note: is doneLoagingAnimation
a typo? (Loaging vs Loading)
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
App crashing because of paused animation and ...
Property animators must either finish animating or be explicitly stopped and finished before they can be released.' Has anyone come across this?
Read more >Animate crashes on launch or startup - Adobe Support
Solution. To fix Animate crash issues, perform the following troubleshooting tasks: Restore preferences.
Read more >Crash at end of animation - Spine
Hi, I've an animation (not looping) which have an event at the last key of the animation. I recentely updated the runtime from...
Read more >Window.requestAnimationFrame() - Web APIs | MDN
This will request that your animation function be called before the ... when requestAnimationFrame() starts to execute callback functions.
Read more >Property Animation Overview | Android Developers
At the end of 40ms, the animation stops, and the object ends at horizontal position 40. ... When you call start() the animation...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This problem was corrected prior version 2.0.0. Just tested with a stop and done animation being called before the start animation ends and no problem happens. Fell free to reopen the issue if you still experience this bug.
I’m having the same issue on these lines. I’m using the current latest version ‘1.14.0’
Would you mind to add a null check before calling stop in
doneLoadingAnimation(int fillColor, Bitmap bitmap)
method? It seems it is the easiest solution. In my case also the state changes sometimes very quickly and it crashes on those cases with the below logs.