dagger android support to androidx.fragment

后端 未结 7 1875
孤城傲影
孤城傲影 2021-02-07 02:47

How to inject a fragment from the package androidx.fragment.app.Fragment ?

I\'m using the dagger-android framework to inject my dependencies in

7条回答
  •  一个人的身影
    2021-02-07 03:38

    add the below code to your gradle.properties

    android.useAndroidX=true
    android.enableJetifier=true

    And if you are trying to inject into a Fragment you have to replace AndroidInjection.inject(this) with AndroidSupportInjection.inject(this)

提交回复
热议问题