realm-java
realm-java copied to clipboard
Avoid storing reference to ApplicationContext
Right now we store a reference in the ApplicationContext which should be avoided due to InstantRun.
Instead we could:
- Just get the reference to
context.getFilesDir()
and save that - get AssetManager and save that
- Register the network receiver on
init()
without saving the context
I don't think we use it for anything else, but this approach would also work for any future additions.
Perhaps we could wrap it in a AndroidContext<Wrapper/Facade/Mediator>
class ?
Register the network receiver on init() without saving the context
was done in https://github.com/realm/realm-java/pull/3529