Android Hilt inheritance with ViewModel, how to make child with empty constructor

Viewed 744

Let's suppose I have a basic ViewModel class:

@HiltViewModel
open class BaseViewModel @Inject constructor(
    private val auth: FirebaseAuth,
    private val firebaseCrashlytics: FirebaseCrashlytics
): ViewModel() {

}

Is there a way how to extend the BaseViewModel without passing the arguments to the constructor?

@HiltViewModel
class ChildViewModel @Inject constructor(
    private val firebaseAuth: FirebaseAuth,
    private val firebaseCrashlytics: FirebaseCrashlytics
) : BaseViewModel(firebaseAuth, firebaseCrashlytics) {

}

I found one related question but unfortunately without any answers here

0 Answers
Related