How to use Dagger's 2 @Named qualifier in Kotlin How to use Dagger's 2 @Named qualifier in Kotlin android android

How to use Dagger's 2 @Named qualifier in Kotlin


I had to update my answer since Kotlin improved a lot. Right now I am using Kotlin 1.0 beta 3

To properly set multiple annotations for a property you have to use @field annotation:

@field:[Inject Named("bold")]lateinit var boldTypeface: Typeface

Note that I am using lateinit here so there is no need to use nullable type Typeface?