Possible Solution
I had the same problem. I install animation , and in onAnimationEnd I delete the object that was animated when problems arise. What I did was configure the asynchronous Runnable to wait 100 milliseconds after the animation stops before deleting the animated object:
previously animated this._loader object
private void removeLoader() { final ContentContainer self = this; // "CustomContainer" needs to match the type of `this` Handler h = new Handler(); h.postAtTime(new Runnable() { @Override public void run() { MainActivity.instance.runOnUiThread(new Runnable() { @Override public void run() { try { if(self._loader == null) { // there is no loader. quit now while you still have the chance!! return; } while(self._loader.getParent() != null) { removeView(self._loader); } } catch(Exception e) { Crashlytics.logException(e); e.printStackTrace(); } self._loader = null; } }); } }, 100); }
Greeting
Jacksonkr Feb 04 '16 at 15:29 2016-02-04 15:29
source share