public class ServiceHandler
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
class |
ServiceHandler.ServiceConnection |
static interface |
ServiceHandler.ServiceConnectionCallback |
| Constructor and Description |
|---|
ServiceHandler(android.content.Context context,
android.content.ComponentName componentName,
ServiceHandler.ServiceConnectionCallback serviceConnectionCallback) |
ServiceHandler(android.content.Context context,
android.content.ComponentName componentName,
java.lang.String action,
ServiceHandler.ServiceConnectionCallback serviceConnectionCallback) |
ServiceHandler(android.content.Context context,
java.lang.String packageName,
java.lang.String action,
ServiceHandler.ServiceConnectionCallback serviceConnectionCallback) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
bindService()
Try to bindService.
|
boolean |
checkServiceAccessable() |
long |
getImmortalTicket()
Get a ticket for a work continued longer than 30 sec.
|
long |
getTicket()
Get a ticket for a work
|
boolean |
isTicketExist(long ticket)
Check if your ticket is exist
|
boolean |
releaseTicket(long ticket)
Release your working ticket
|
public ServiceHandler(android.content.Context context,
java.lang.String packageName,
java.lang.String action,
ServiceHandler.ServiceConnectionCallback serviceConnectionCallback)
public ServiceHandler(android.content.Context context,
android.content.ComponentName componentName,
ServiceHandler.ServiceConnectionCallback serviceConnectionCallback)
public ServiceHandler(android.content.Context context,
android.content.ComponentName componentName,
java.lang.String action,
ServiceHandler.ServiceConnectionCallback serviceConnectionCallback)
public boolean checkServiceAccessable()
public boolean bindService()
public long getTicket()
public long getImmortalTicket()
public boolean releaseTicket(long ticket)
ticket - Your working ticketpublic boolean isTicketExist(long ticket)
ticket -