Answer the question
In order to leave comments, you need to log in
Do I need to unsubscribe from observers and remove links when the activity is destroyed, or is everything done by itself?
And what else needs to be done when the activity is destroyed so that the garbage collector works correctly?
I sometimes hear that you need to unsubscribe observers, but what else is needed?
Answer the question
In order to leave comments, you need to log in
Yes, in onDestroy it is better to unsubscribe everything that has been signed up to this point. You need to release all the resources that potentially live longer than the activity.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question