I need to reference an activity in several static methods. I’m curious to know the best practices to avoid memory leaks. Let’s use examples: Example 1: Example 2: So three questions: Do example 1 or 2 make any difference? I haven’t seen methods being called this way much outside of subclasses of Thread or AsyncTask. Any reason why? Am I
Tag: weak-references
A rare usage of WeakReference?
I have a class whose instances are initialized and used by underlying flatform. Nothing’s wrong and I thought I need to add some static methods for being used as method references. Still nothing seems wrong (I believe) and I don’t like the instance persisted with the class and that’s why I’m trying to do this. I basically don’t even know