public class

ServiceManager

extends Object
java.lang.Object
   ↳ com.davidluoye.support.os.ServiceManager

Summary

Public Methods
static void addService(String name, IBinder service)
Place a new @a service called @a name into the service manager.
static IBinder checkService(String name)
Retrieve an existing service called @a name from the service manager.
static IBinder getService(String name)
Returns a reference to a service with the given name.
static String[] listServices()
Return a list of all currently running services.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static void addService (String name, IBinder service)

Place a new @a service called @a name into the service manager.

Parameters
name the name of the new service
service the service object

public static IBinder checkService (String name)

Retrieve an existing service called @a name from the service manager. Non-blocking.

public static IBinder getService (String name)

Returns a reference to a service with the given name.

Important: May block the calling thread!

Parameters
name the name of the service to get
Returns
  • a reference to the service, or null if the service doesn't exist

public static String[] listServices ()

Return a list of all currently running services.