Mark a class that can be injected by a Injector and does not support fallback. It's implemented by ViewModel Factories when the ViewModel lifecycle is shorter than the activity that contains it. In those cases, they receive the Injector directly as a constructor parameter and should not be responsible for recreating the dependency graph.

See also


Link copied to clipboard
open override fun fallbackInitialize(arg: Unit): Nothing

NonFallbackInjectable classes don't implement fallback because they receive the injector directly as a constructor parameter.


Link copied to clipboard

Try to use an InjectorKey to retrieve an Injector and inject, if no Injector is found, invoke Injectable.fallbackInitialize with fallbackInitializeParam.