title: Dagger 2 is overlooking provides method
body: <p>In my Android app I'm trying to get a DatabaseHelper object injected into ArticleView but Dagger complains with the following error message:</p>
  
  <pre><code>Error:(11, 7) error: android.content.Context cannot be provided without an @Provides-annotated method.
  dk.jener.paperflip.ArticleActivity.database
  [injected field of type: dk.jener.paperflip.model.retriever.DatabaseHelper database]
  dk.jener.paperflip.model.retriever.DatabaseHelper.&lt;init&gt;(android.content.Context context)
  [parameter: android.content.Context context]
  </code></pre>
  
  <p>How do I fix it?</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>@Singleton
  @Module
  public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
  
      @Inject
      public DatabaseHelper(Context context) {
          super(context, "foobar", null, 1);
      }
      ...
  }
  
  @Module
  public class ApplicationContextModule {
      private final Context context;
  
      public ApplicationContextModule(Context context) {
          this.context = context;
      }
  
      @Provides
      @Singleton
      public Context provideApplicationContext() {
          return context;
      }
  }
  
  @Singleton
  @Component(modules = { DatabaseHelper.class })
  public interface RetrieverComponent {
      void inject(ArticleActivity activity);
  }
  
  public class ArticleActivity extends AppCompatActivity {
      @Inject
      DatabaseHelper database;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          ...
          RetrieverComponent component = DaggerRetrieverComponent.builder()
                  .applicationContextModule(new ApplicationContextModule(getApplicationContext()))
                  .build();
          component.inject(this);
      }
      ...
  }
  </code></pre>
  
  <p>As far as I can figure Context is already provided by ApplicationContextModule#provideApplicationContext .</p>