life

fun life(lifecycleOwner: LifecycleOwner, lifeEvent: Lifecycle.Event = Lifecycle.Event.ON_DESTROY): <ERROR CLASS>

自动在指定生命周期后取消cancel轮询器

Parameters

lifecycleOwner

生命周期持有者, 一般为Activity/Fragment

lifeEvent

销毁生命周期, 默认为 Lifecycle.Event.ON_DESTROY 时停止时停止轮询器

fun life(fragment: Fragment, lifeEvent: Lifecycle.Event = Lifecycle.Event.ON_DESTROY): Interval

自动在指定生命周期后取消cancel轮询器

Parameters

lifeEvent

销毁生命周期, 默认为 Lifecycle.Event.ON_DESTROY 时停止时停止轮询器