I wonder if runnable passed to View.postDelayed
will be automatically removed when the view is detached from the parent.
I looked in the source of the View
class and it is posted to some Handler
that it gets outside. But life cycle of that handler is not clear.
Does anyone know the answer?
I wonder if runnable passed to View.postDelayed will be automatically removed when the view is detached from the parent.
It will after the run method finishes to execute. If you have a infinite loop into it, it will never be removed and, therefore, you will leak the view, and the Activity that uses that view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With