Service

Class of android.app · Service.java · Android's reference

public abstract class Service extends android.content.ContextWrapper implements ComponentCallbacks2

Service ← ContextWrapper ← Context

A background component: started or bound in the process.

Extended in the framework by

Fields

public static final int START_STICKY_COMPATIBILITY = 0 source
public static final int START_STICKY = 1 source
public static final int START_NOT_STICKY = 2 source
public static final int START_REDELIVER_INTENT = 3 source
public static final int START_CONTINUATION_MASK = 0xf source
public static final int START_FLAG_REDELIVERY = 1 source
public static final int START_FLAG_RETRY = 2 source
public static final int STOP_FOREGROUND_REMOVE = 1 source
public static final int STOP_FOREGROUND_DETACH = 2 source
public static final int STOP_FOREGROUND_LEGACY = 0 source

Constructors

public Service() source

Methods

public final void attachService(android.content.Context base, Application app) source

The runtime's attach: the context and the application.

public final Application getApplication() source
public void onCreate() empty body source
public void onStart(Intent intent, int startId) empty body deprecated source
public int onStartCommand(Intent intent, int flags, int startId) source
public void onDestroy() empty body source
public void onConfigurationChanged(Configuration newConfig) empty body source
public void onLowMemory() empty body source
public void onTrimMemory(int level) empty body source
public abstract IBinder onBind(Intent intent) source
public boolean onUnbind(Intent intent) source
public void onRebind(Intent intent) empty body source
public void onTaskRemoved(Intent rootIntent) empty body source
public void onTimeout(int startId) empty body source
public void onTimeout(int startId, int fgsType) empty body source
public final void stopSelf() source
public final void stopSelf(int startId) source
public final boolean stopSelfResult(int startId) source
public final void startForeground(int id, Notification notification) empty body source
public final void startForeground(int id, Notification notification, int foregroundServiceType) empty body source
public final void stopForeground(boolean removeNotification) empty body deprecated source
public final void stopForeground(int notificationBehavior) empty body source
public final int getForegroundServiceType() source

Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.