Package dagger.hilt

Annotation Type 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:
    Hilt Modules
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.Class<?>[] value  
    • Element Detail

      • value

        java.lang.Class<?>[] value