title: Scopes in Dagger 2
body: <p>I probably missed something, but I thought Scopes like  @Singleton are used to define "scoped lifecycles".</p>
  
  <p>I use Dagger 2 in an Android app (but I don't think the problem is android related at all).</p>
  
  <p>I have 1 Module:</p>
  
  <pre><code>@Module public class MailModule {
  
    @Singleton @Provides public AccountManager providesAccountManager() {
      return new AccountManager();
    }
  
    @Singleton @Provides public MailProvider providesMailProvider(AccountManager accountManager) {
      return new MailProvider(accountManager);
    }
  }
  </code></pre>
  
  <p>I have two different components with <code>@Singleton</code> scope:</p>
  
  <pre><code>@Singleton
  @Component(modules = MailModule.class)
  public interface LoginComponent {
  
    public LoginPresenter presenter();
  }
  
  
  @Singleton
  @Component(
      modules = MailModule.class
  )
  public interface MenuComponent {
  
    MenuPresenter presenter();
  
  }
  </code></pre>
  
  <p>Both, <code>MenuPresenter</code> and <code>LoginPresenter</code>, have an <code>@Inject</code> constructor. While MenuPresenter expects <code>MailProvider</code> as parameter, LoginPresenter takes an <code>AccountManager</code>:</p>
  
  <pre><code>  @Inject public MenuPresenter(MailProvider mailProvider) { ... }
  
    @Inject public LoginPresenter(AccountManager accountManager) { ... }
  </code></pre>
  
  <p>But every time I use the components to create a <code>MenuPresenter</code> or <code>LoginPresenter</code> I get a fresh new instance of <code>MailProvider</code> and <code>AccountManager</code>. I thought they were in the same scope and should therefore be kind of singleton (in the same scope).</p>
  
  <p>Did I understand something completely wrong. How do I define a real singleton for multiple components in dagger 2? </p>