Michael Spitsin
1 min readSep 18, 2017

--

Yes, because they depend only by view, where they were defined. Also, when onDetachedFromWindow or setVisibility(GONE) is called, animation will be stopped, thus, updating listener will not be called over and over again.

So, when garbage collector will decide to delete this view or not, it will see that this view depends on listener and vice versa. So there is cyclic dependency, which can be recognized by garbage collector and, thus, removed.

--

--

Michael Spitsin
Michael Spitsin

Written by Michael Spitsin

Love being creative to solve some problems with an simple and elegant ways

No responses yet