title: Kotlin interface with generics and Dagger
body: <p>I have an interface defined where I have a generic type with the following</p>
  
  <pre><code>interface ActivityService&lt;T&gt; {
    fun getActivities(context: Context, listener: GetActivitiesListener&lt;T&gt;)
    fun addActivity(activity: T, context: Context, listener: AddActivityListener)
  }
  </code></pre>
  
  <p>And is implemented with</p>
  
  <pre><code>class AwsActivityService : ActivityService&lt;Activity&gt; {
  
  override fun addActivity(activity: Activity, context: Context, listener: AddActivityListener) {
      AddActivityAsyncTask(activity, context, object : AddActivityAsyncTask.ActivityTaskListener {
          override fun onTaskComplete(result: Boolean) {
              listener.onTaskComplete(result)
          }
      }).execute()
  }
  
  override fun getActivities(context: Context, listener: GetActivitiesListener&lt;Activity&gt;) {
      GetActivitiesAsyncTask(context, object : GetActivitiesAsyncTask.ActivityTaskListener {
          override fun onTaskComplete(activityList: List&lt;Activity&gt;) {
              return listener.onTaskComplete(activityList)
          }
      }).execute()
  }
  </code></pre>
  
  <p>}</p>
  
  <p>How do you then define the generics for the module within Dagger when instantiating AwsActivityService?</p>
  
  <pre><code>@Module
  class ActivitiesModule() {
  
      @Provides
      @Inject
      @Singleton
      internal fun provideActivitiesModule(): ActivityService {
          return AwsActivityService()
      }
  }
  </code></pre>