How to handle SoftReference listeners after it has been GC'd?

72 Views Asked by At

So I've been playing with this new library and I noticed that one of the listeners that I must provide context with is binded through a SoftReference.

My activity does a lot of heavy lifting even when it is put through the background which may cause this SoftReference to get GC'd...which isn't good because i'm listening for some event that could happen any time.

What's the proper way to handle this in the event that this listener gets GC'd?

0

There are 0 best solutions below