Introduction to Dagger 2, Using Dependency Injection in Android: Part 2
Janishar Ali

It’s important to note that the @Singleton annotation does not mean a singleton in the traditional way we know it. @Singleton is the same as a custom scope, which means that all modules scoped to a component will be the same for a single instance of the component. If you create one component, it will create scoped dependencies and reuse those dependencies for that component. If you create another component, it will have different dependencies from the first component.

@Singleton should really be avoided because of this confusion.

Show your support

Clapping shows how much you appreciated Stephen Brough’s story.