public class ServiceLifecycleDispatcher
extends Object

   ↳ androidx.lifecycle.ServiceLifecycleDispatcher

Helper class to dispatch lifecycle events for a service. Use it only if it is impossible to use LifecycleService.


Public constructors

ServiceLifecycleDispatcher(LifecycleOwner provider)

Public methods

Lifecycle getLifecycle()
void onServicePreSuperOnBind()

Must be a first call in Service.onBind(Intent) method, even before super.onBind call.

void onServicePreSuperOnCreate()

Must be a first call in Service.onCreate() method, even before super.onCreate call.

void onServicePreSuperOnDestroy()

Must be a first call in Service.onDestroy() method, even before super.OnDestroy call.

void onServicePreSuperOnStart()

Must be a first call in Service.onStart(Intent, int) or Service.onStartCommand(Intent, int, int) methods, even before a corresponding super call.

Inherited methods

Public constructors