Q:

Android inject from BaseActivity to all classes which extended from BaseActivity

In my application I'm using Dagger and some activities are using that and I want to implement this injection on BaseActivity instead of implementing injection on all activities which I want to use Dagger for example:
this is my LoginActivity:
class LoginActivity : AppCompatActivity(){
    @Inject
    internal lateinit var personsRemoteRepository: PersonsRemoteRepository

    @Inject
    internal var restClient: RestClient? = null

    private var component: ApplicationComponent? = null
    private var mBinding: LoginActivityBinding? = null
    private var viewModel: LoginMethodsViewModel? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        component = DaggerApplicationComponent.builder()
                .projectApplicationComponent(CoreApplication.getComponent())
                .build()
        component?.inject(this)

        mBinding = DataBindingUtil.setContentView(this, R.layout.login_activity)

        personsRemoteRepository = PersonsRemoteRepository(restClient)
        viewModel = LoginMethodsViewModel(personsRemoteRepository, this, mBinding)
        mBinding!!.viewModel = viewModel
    }
}

in this activity I use DaggerApplicationComponent to inject, now I want to have BaseActivity such as this class:
open class BaseActivity : AppCompatActivity() {
    protected var component: ApplicationComponent? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        component = DaggerApplicationComponent.builder()
                .projectApplicationComponent(CoreApplication.getComponent())
                .build()
        component?.inject(this)
    }
}

and when I extend this class instead of AppCompatActivity on LoginActivity I can use inject, for example:
class LoginActivity : BaseActivity (){
    @Inject
    internal lateinit var personsRemoteRepository: PersonsRemoteRepository

    @Inject
    internal var restClient: RestClient? = null

    private var component: ApplicationComponent? = null
    private var mBinding: LoginActivityBinding? = null
    private var viewModel: LoginMethodsViewModel? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        mBinding = DataBindingUtil.setContentView(this, R.layout.login_activity)

        personsRemoteRepository = PersonsRemoteRepository(restClient)
        viewModel = LoginMethodsViewModel(personsRemoteRepository, this, mBinding)
        mBinding!!.viewModel = viewModel
    }
}

A:

This functionality is not supported with dagger-java. But if you use dagger-android with it and have the activity extent with DaggerActivity, it will work like you want it to. There are a few other things which have to be added with it. Like refactoring application class to extend it with DaggerApplication and adding refactoring ApplicationComponent in your case. Kindly go through the dagger-android documentation or just go through the post I have written about it. 
https://medium.com/@ninad458/exploring-android-dagger-9c325c6acfe3
Just going through the prerequisites would suffice.

