Example usage for Java android.app Service fields, constructors, methods, implement or subclass
The text is from its open source code.
int | START_STICKY_COMPATIBILITY Constant to return from #onStartCommand : compatibility version of #START_STICKY that does not guarantee that #onStartCommand will be called again after being killed. |
int | START_STICKY Constant to return from #onStartCommand : if this service's process is killed while it is started (after returning from #onStartCommand ), then leave it in the started state but don't retain this delivered intent. |
int | START_NOT_STICKY Constant to return from #onStartCommand : if this service's process is killed while it is started (after returning from #onStartCommand ), and there are no new start intents to deliver to it, then take the service out of the started state and don't recreate until a future explicit call to Context#startService Context.startService(Intent) . |
int | START_REDELIVER_INTENT Constant to return from #onStartCommand : if this service's process is killed while it is started (after returning from #onStartCommand ), then it will be scheduled for a restart and the last delivered Intent re-delivered to it again via #onStartCommand . |
int | START_FLAG_REDELIVERY This flag is set in #onStartCommand if the Intent is a re-delivery of a previously delivered intent, because the service had previously returned #START_REDELIVER_INTENT but had been killed before calling #stopSelf(int) for that Intent. |
int | START_FLAG_RETRY This flag is set in #onStartCommand if the Intent is a retry because the original attempt never got to or returned from #onStartCommand(Intent,int,int) . |
Application | getApplication() Return the application that owns this service. |
Context | getApplicationContext() |
Class> | getClass() Returns the runtime class of this Object . |
Resources | getResources() |
SharedPreferences | getSharedPreferences(String name, int mode) |
String | getString(@StringRes int resId) Returns a localized string from the application's package's default string table. |
Object | getSystemService(String name) |
void | onCreate() Called by the system when the service is first created. |
void | sendBroadcast(Intent intent) |
void | startActivity(Intent intent) |
void | startForeground(int id, Notification notification) If your service is started (running through Context#startService(Intent) ), then also make this service run in the foreground, supplying the ongoing notification to be shown to the user while in this state. |
void | stopForeground(boolean removeNotification) Synonym for #stopForeground(int) . |
void | stopForeground(@StopForegroundFlags int flags) Remove this service from foreground state, allowing it to be killed if more memory is needed. |
void | stopSelf(int startId) Old version of #stopSelfResult that doesn't return a result. |