Skip to content

Most visited

Recently visited

navigation

LifecycleService

public class LifecycleService
extends Service implements LifecycleOwner

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


A Service that is also a LifecycleOwner.

Summary

Inherited constants

From class android.app.Service
From class android.content.Context
From interface android.content.ComponentCallbacks2

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

From class android.app.Service
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks2
From interface android.arch.lifecycle.LifecycleOwner
From interface android.content.ComponentCallbacks

Public constructors

LifecycleService

LifecycleService ()

Public methods

getLifecycle

Lifecycle getLifecycle ()

Returns the Lifecycle of the provider.

Returns
Lifecycle The lifecycle of the provider.

onBind

IBinder onBind (Intent intent)

Parameters
intent Intent

Returns
IBinder

onCreate

void onCreate ()

onDestroy

void onDestroy ()

onStart

void onStart (Intent intent, 
                int startId)

Parameters
intent Intent

startId int

onStartCommand

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

Parameters
intent Intent

flags int

startId int

Returns
int

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.