Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
added in version 2.0.0
belongs to Maven artifact androidx.lifecycle:lifecycle-service:2.0.0-rc01

LifecycleService

public class LifecycleService
extends Service implements LifecycleOwner

java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Service
         ↳ androidx.lifecycle.LifecycleService


A Service that is also a LifecycleOwner.

Summary

Inherited constants

Public constructors

LifecycleService()

Public methods

Lifecycle getLifecycle()

Returns the Lifecycle of the provider.

IBinder onBind(Intent intent)
void onCreate()
void onDestroy()
void onStart(Intent intent, int startId)
int onStartCommand(Intent intent, int flags, int startId)

Inherited methods

Public constructors

LifecycleService

added in version 2.0.0
public LifecycleService ()

Public methods

getLifecycle

added in version 2.0.0
public Lifecycle getLifecycle ()

Returns the Lifecycle of the provider.

Returns
Lifecycle The lifecycle of the provider.

onBind

added in version 2.0.0
public IBinder onBind (Intent intent)

Parameters
intent Intent

Returns
IBinder

onCreate

public void onCreate ()

onDestroy

public void onDestroy ()

onStart

added in version 2.0.0
public void onStart (Intent intent, 
                int startId)

Parameters
intent Intent

startId int

onStartCommand

public int onStartCommand (Intent intent, 
                int flags, 
                int startId)

Parameters
intent Intent

flags int

startId int

Returns
int