architecture-components-samples
architecture-components-samples copied to clipboard
Injected Activity should be marked with Injectable, not HasSupportFragmentInjector
The AppInjector class looks for activities with HasSupportFragmentInjector interface overridden and then calls AndroidInjection.inject(activity); on them. I think it would make more sense if it looked for Injectable. HasSupportFragmentInjector should be rather used to mark activities which inflate support fragments which need to be injected via dagger. In the example there's only one activity which does both, but there can be situations where it's not really semantically correct.
See here, line 80: https://github.com/googlesamples/android-architecture-components/blob/master/GithubBrowserSample/app/src/main/java/com/android/example/github/di/AppInjector.java