DEV Community

Discussion on: Android Vitals - First draw time 👩‍🎨

Collapse
 
sewerk profile image
Kamil Seweryn

what if (view.viewTreeObserver.isAlive) is false and we won't viewTreeObserver.removeOnDrawListener(this)? Next onDraw callback will return just after firing forever?

Collapse
 
pyricau profile image
Py ⚔

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.