what if (view.viewTreeObserver.isAlive) is false and we won't viewTreeObserver.removeOnDrawListener(this)? Next onDraw callback will return just after firing forever?
The assumption is that if the view tree observer stops being alive then the views are detached from the window (e.g. activity destroyed) so the view tree observer will be gced and this won't fire again ever.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
what
if (view.viewTreeObserver.isAlive)
is false and we won'tviewTreeObserver.removeOnDrawListener(this)
? NextonDraw
callback will return just after firing forever?The assumption is that if the view tree observer stops being alive then the views are detached from the window (e.g. activity destroyed) so the view tree observer will be gced and this won't fire again ever.