4 ms·
From what I've seen, Java's GC is smart enough to clean up circular references. That actually surprised me. The main danger I've seen in Android is that there i
by gumballhead 11y ago
From what I've seen, Java's GC is smart enough to clean up circular references. That actually surprised me. The main danger I've seen in Android is that there is a lot of passing around Contexts as a dependency for accessing Android resources, many of which are meant to be short lived, like Activities. Sometimes a class will save that context as an instance variable. And sometimes you might want to cache that class statically, so if you aren't careful, you'll prevent something like an Activity from garbage collection.