ServiceLifecycleDispatcher
public class ServiceLifecycleDispatcher
Helper class to dispatch lifecycle events for a Service. Use it only if it is impossible to use LifecycleService.
Summary
Public constructors |
|---|
ServiceLifecycleDispatcher(@NonNull LifecycleOwner provider) |
Public methods |
|
|---|---|
@NonNull Lifecycle |
|
void |
Must be a first call in |
void |
Must be a first call in |
void |
Must be a first call in |
void |
Must be a first call in |
Public constructors
ServiceLifecycleDispatcher
public ServiceLifecycleDispatcher(@NonNull LifecycleOwner provider)
| Parameters | |
|---|---|
@NonNull LifecycleOwner provider |
|
Public methods
getLifecycle
public @NonNull Lifecycle getLifecycle()
Lifecycle for the given LifecycleOwner
onServicePreSuperOnBind
public void onServicePreSuperOnBind()
Must be a first call in Service.onBind method, even before super.onBind call.
onServicePreSuperOnCreate
public void onServicePreSuperOnCreate()
Must be a first call in Service.onCreate method, even before super.onCreate call.
onServicePreSuperOnDestroy
public void onServicePreSuperOnDestroy()
Must be a first call in Service.onDestroy method, even before super.OnDestroy call.
onServicePreSuperOnStart
public void onServicePreSuperOnStart()
Must be a first call in Service.onStart or Service.onStartCommand methods, even before a corresponding super call.