Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

LifecycleService

open class LifecycleService : Service, LifecycleOwner
kotlin.Any
   ↳ android.content.Context
   ↳ android.content.ContextWrapper
   ↳ android.app.Service
   ↳ androidx.lifecycle.LifecycleService

A Service that is also a LifecycleOwner.

Summary

Public constructors

A Service that is also a LifecycleOwner.

Public methods

open Lifecycle

open IBinder?
onBind(@NonNull intent: Intent)

open Unit

open Unit

open Unit
onStart(@Nullable intent: Intent?, startId: Int)

open Int
onStartCommand(@Nullable intent: Intent?, flags: Int, startId: Int)

Public constructors

<init>

LifecycleService()

A Service that is also a LifecycleOwner.

Public methods

getLifecycle

@NonNull open fun getLifecycle(): Lifecycle

onBind

@CallSuper @Nullable open fun onBind(@NonNull intent: Intent): IBinder?

onCreate

@CallSuper open fun onCreate(): Unit

onDestroy

@CallSuper open fun onDestroy(): Unit

onStart

@CallSuper open fun onStart(@Nullable intent: Intent?, startId: Int): Unit

onStartCommand

@CallSuper open fun onStartCommand(@Nullable intent: Intent?, flags: Int, startId: Int): Int