Reputation: 305
I have in my AppModule following notation:
@Provides
@ApplicationContext
fun provideAppContext(app: Application): Context = app
and I want to use it in abstract class
@Inject
@ApplicationContext
lateinit var mContext: Context
But when I try to use the context (for call ressources.getString(..)), I get following error:
lateinit property mContext has not been initialized
Upvotes: 0
Views: 258
Reputation: 4354
for abstract class u cannot able to call the constructor.So better to use child class.
Upvotes: 1