need release resources on OnDestroyView?
Closed this issue · 4 comments
mokhtarabadi commented
is I need to release resources for my views in every scene after onDestoryView called for example If I have an imageView, called setImageDrawable to null or if I using Picasso, call cancel method for Picasso? did I need something like this?
qii commented
ImageView drawable does not need to be cleaned up specially, but asynchronous tasks(like Picasso or Glide) may be needed because they does not know the Scene lifecycle
mokhtarabadi commented
I just said imageView for example, because I use ScenePagerAdapter and when
I release resources for imageView in child pages , I see the ram usage
decreased when scene closed
But if I don't do, ram usage will not decrease when parent Scene closed
(mean the scene contains the view pager)
qii commented
garbage collection is not so fast, you can try "force garbage collection" button to force gc https://developer.android.com/studio/profile/memory-profiler
mokhtarabadi commented
Thanks, I forgotten java garbage collector...