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.
public static final int START_STICKY_COMPATIBILITY = 0 sourcepublic static final int START_STICKY = 1 sourcepublic static final int START_NOT_STICKY = 2 sourcepublic static final int START_REDELIVER_INTENT = 3 sourcepublic static final int START_CONTINUATION_MASK = 0xf sourcepublic static final int START_FLAG_REDELIVERY = 1 sourcepublic static final int START_FLAG_RETRY = 2 sourcepublic static final int STOP_FOREGROUND_REMOVE = 1 sourcepublic static final int STOP_FOREGROUND_DETACH = 2 sourcepublic static final int STOP_FOREGROUND_LEGACY = 0 sourcepublic Service() sourcepublic final void attachService(android.content.Context base, Application app) sourceThe runtime's attach: the context and the application.
public final Application getApplication() sourcepublic void onCreate() empty body sourcepublic void onStart(Intent intent, int startId) empty body deprecated sourcepublic int onStartCommand(Intent intent, int flags, int startId) sourcepublic void onDestroy() empty body sourcepublic void onConfigurationChanged(Configuration newConfig) empty body sourcepublic void onLowMemory() empty body sourcepublic void onTrimMemory(int level) empty body sourcepublic abstract IBinder onBind(Intent intent) sourcepublic boolean onUnbind(Intent intent) sourcepublic void onRebind(Intent intent) empty body sourcepublic void onTaskRemoved(Intent rootIntent) empty body sourcepublic void onTimeout(int startId) empty body sourcepublic void onTimeout(int startId, int fgsType) empty body sourcepublic final void stopSelf() sourcepublic final void stopSelf(int startId) sourcepublic final boolean stopSelfResult(int startId) sourcepublic final void startForeground(int id, Notification notification) empty body sourcepublic final void startForeground(int id, Notification notification, int foregroundServiceType) empty body sourcepublic final void stopForeground(boolean removeNotification) empty body deprecated sourcepublic final void stopForeground(int notificationBehavior) empty body sourcepublic final int getForegroundServiceType() sourceMade 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.