```@Module class AppModule { @Provides @Si...
# dagger
s
Copy code
@Module
class AppModule {
    @Provides
    @Singleton
    @Named("application context" )
    fun provideContext( app : Application ) : Context = app

    @Provides
    @Singleton
    fun provideWindowManager( @Named( "application context" ) context : Context ) : WindowManager {
        ...
    }
}

or

@Qualifier
@Documented
@Retention(AnnotationRetention.RUNTIME)
annotation class ApplicationContext
@Module
class AppModule {

    @Provides
    @Singleton
    @ApplicationContext
    fun provideApplicationContext( app : Application ) : Context = app

    @Provides
    @Singleton
    fun provideWindowManager( @ApplicationContext context : Context ) : WindowManager {
        ...
    }

}