Package dagger.hilt

Annotation Interface InstallIn


@Retention(CLASS) @Target(TYPE) public @interface InstallIn
An annotation that declares which component(s) the annotated class should be included in when Hilt generates the components. This may only be used with classes annotated with @Module or @EntryPoint.

Example usage for installing a module in the generated ApplicationComponent:


   @Module
   @InstallIn(SingletonComponent.class)
   public final class FooModule {
     @Provides
     static Foo provideFoo() {
       return new Foo();
     }
   }
 
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Class<?>[]
     
  • Element Details

    • value

      Class<?>[] value