title: Why use Dagger 2 HasActivityInjector?
body: <p>Hy</p>
  <p>I would like to use Dagger 2 in my application, but I'm a little bit confused.</p>
  <p>In youtube tutorial videos, I saw an implementation similar to this: <a href="https://medium.com/@serapbercin001/how-to-use-android-injector-for-activity-and-fragment-objects-through-new-dagger-2-with-kotlin-704eb8a98c43" rel="nofollow noreferrer">HasActivityInjector</a>, but I also saw <a href="https://codelabs.developers.google.com/codelabs/android-dagger/#0" rel="nofollow noreferrer">CodeLabs dagger 2 tutorial</a>, and there wasn't mentioned this HasActivityInjector, but there was an activity injecting.</p>
  <p>So, these two are similar, or did I have misunderstood something?</p>
  <pre><code>CodeLabs:
  
  @Component(modules = [StorageModule::class])
  interface AppComponent {
      ...
  
      // Classes that can be injected by this Component
      fun inject(activity: RegistrationActivity)
      fun inject(activity: MainActivity)
  }
  
  
  class MainActivity : AppCompatActivity() {
      ...
      override fun onCreate(savedInstanceState: Bundle?) {
  
          (application as MyApplication).appComponent.inject(this)
  
          super.onCreate(savedInstanceState)
          ...
      }
  }
  
  Other implementation: 
  
  class SampleApplication : Application(), HasActivityInjector {
  
      @Inject
      lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector&lt;Activity&gt;
  
  
      override fun onCreate() {
          super.onCreate()
          DaggerApplicationComponent.builder()
                  .applicationBind(this)
                  .build()
                  .inject(this)
  
      }
  
      override fun activityInjector(): AndroidInjector&lt;Activity&gt; = dispatchingAndroidInjector
  
  }
  
  class MainActivity : AppCompatActivity(){ 
  override fun onCreate(savedInstanceState: Bundle?) {
     AndroidInjection.inject(this)
     super.onCreate(savedInstanceState)
     setContentView(R.layout.activity_main)
  }
  }
  
  </code></pre>