getRootUnits

abstract fun getRootUnits(callback: (Result<List<SensorbergUnit.RootUnit>>) -> Unit): Cancelable

Support function to get all root units returning Cancelable.

Note: The purpose of this function is to support clients that can not use Coroutines or the Kotlin programming language!

Since

1.5.0

Return

Cancelable It is your responsibility to cancel this operation, when no longer needed, to avoid memory leaks.

Parameters

callback

receiving the Result of a list of SensorbergUnit.RootUnit.

abstract fun getRootUnits(lifecycleOwner: LifecycleOwner, callback: (Result<List<SensorbergUnit.RootUnit>>) -> Unit): Cancelable

Support function to get all root units returning Cancelable.

Note: The purpose of this function is to support clients that can not use Coroutines or the Kotlin programming language!

Since

1.9.0

Return

Cancelable In case you want to cancel before Lifecycle.State.DESTROYED.

Parameters

lifecycleOwner

auto cancel the Cancelable when lifecycle state is Lifecycle.State.DESTROYED.

callback

receiving the Result of a list of SensorbergUnit.RootUnits.