android.support.v4.app
Class ServiceCompat

java.lang.Object
  extended by android.support.v4.app.ServiceCompat

public class ServiceCompat
extends Object

Helper for accessing features in Service introduced after API level 4 in a backwards compatible fashion.


Field Summary
static int START_STICKY
          Constant to return from Service.onStartCommand(android.content.Intent, int, int): if this service's process is killed while it is started (after returning from Service.onStartCommand(android.content.Intent, int, int)), then leave it in the started state but don't retain this delivered intent.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

START_STICKY

public static final int START_STICKY
Constant to return from Service.onStartCommand(android.content.Intent, int, int): if this service's process is killed while it is started (after returning from Service.onStartCommand(android.content.Intent, int, int)), then leave it in the started state but don't retain this delivered intent. Later the system will try to re-create the service. Because it is in the started state, it will guarantee to call Service.onStartCommand(android.content.Intent, int, int) after creating the new service instance; if there are not any pending start commands to be delivered to the service, it will be called with a null intent object, so you must take care to check for this.

This mode makes sense for things that will be explicitly started and stopped to run for arbitrary periods of time, such as a service performing background music playback.

See Also:
Constant Field Values


Copyright © 2013 Marek Kedzierski. All Rights Reserved.