Leonids
Leonids copied to clipboard
Bug causing crash
The particle system is causing crash in some devices. The crash report is as follows:-
Fatal Exception: java.lang.NullPointerException Attempt to invoke virtual method 'void android.view.View.postInvalidate()' on a null object reference
com.plattysoft.leonids.ParticleSystem.onUpdate (ParticleSystem.java:683) com.plattysoft.leonids.ParticleSystem.access$100 (ParticleSystem.java:38) com.plattysoft.leonids.ParticleSystem$ParticleTimerTask.run (ParticleSystem.java:82)
same question...
I am curious as how did the drawingView became null. Maybe the app was put into the background and the views destroyed while the animation was still running?
Do you have any insights on that? Or on Android version, or on how frequent it is?
Looks like it could be easily solved by adding a try catch and canceling the animation inside the catch.
I use TimerTask to launch and call the cancel method. This happens occasionally.
Now I use stopEmitting instead of cancel