public abstract class ServiceContext extends Object
| Modifier and Type | Method and Description |
|---|---|
abstract Context |
getServiceContext()
Returns the service context.
|
abstract Intent |
getServiceIntent()
Returns the service intent.
|
static ServiceContext |
serviceFrom(Context context)
Returns a context based on the specified instance.
The default RoutineService class
will
be employed. |
static ServiceContext |
serviceFrom(Context context,
Class<? extends RoutineService> serviceClass)
Returns a context based on the specified instance, employing a service of the specified
type.
|
static ServiceContext |
serviceFrom(Context context,
Intent service)
Returns a context based on the specified instance, employing the specified intent to start
the service.
|
@Nonnull public static ServiceContext serviceFrom(@Nonnull Context context)
RoutineService class
will
be employed.context - the context.@Nonnull public static ServiceContext serviceFrom(@Nonnull Context context, @Nonnull Class<? extends RoutineService> serviceClass)
context - the context.serviceClass - the service type.@Nonnull public static ServiceContext serviceFrom(@Nonnull Context context, @Nonnull Intent service)
context - the context.service - the service intent.@Nullable public abstract Context getServiceContext()