InstanceLifecycleManager
class InstanceLifecycleManager<T>(onCreateInstance: (context: Context) -> T, onDestroyInstance: (instance: T) -> Unit)
Content copied to clipboard
This class can be used to manage the lifecycle of an instance. onCreateInstance will be called to notify that an instance has been requested and should provide a new instance of T. onDestroyInstance will be called when all LifecycleOwners associated to an instance are destroyed.