I assume that you are using the Injection library (perhaps a dagger looking at your code) and Presenter
annotated using @Singleton
? If so, then setting the value to zero is one of the parameters (and yes, you should not save the Activity
instance when changing the configuration).
Another option is to use WeakReference
in your Presenter
, so setting to null
not required, although setting to null
more explicit.
You can use the interfaces with your Presenter
, and not expose the entire Activity
a Presenter instance - you can already do something like this, but not 100% clear the code provided.
source share