public class SimpleDispatcher extends Object implements Task.Dispatcher
Use attach(Handler) to set an existing handler, which is used to schedule task
with the executor or executor an task.
TAG| 构造器和说明 |
|---|
SimpleDispatcher() |
| 限定符和类型 | 方法和说明 |
|---|---|
SimpleDispatcher |
attach(android.os.Handler scheduler)
Attach an existing scheduler to dispatcher, so that we don't need to create an new one.
|
void |
finish(Runnable runnable)
When a task is finished, it will call this method.
|
boolean |
has(int what)
Check if there exists the task with the specific id.
|
boolean |
has(Runnable runnable)
已过时。
|
boolean |
isRunning()
Whether or not the dispatcher is working.
|
void |
post(int what,
Runnable runnable)
Add an task to the dispatcher with id.
|
void |
post(Runnable runnable)
Add an task to the dispatcher.
|
void |
postDelay(int what,
Runnable runnable,
long millis)
Schedule an task to the dispatcher with id.
|
void |
postDelay(Runnable runnable,
long millis)
Schedule an task to the dispatcher.
|
void |
shutdown()
Terminate the dispatcher.
|
void |
start()
Start the dispatcher before it can work.
|
public SimpleDispatcher attach(android.os.Handler scheduler)
Task.Dispatcherattach 在接口中 Task.Dispatcherpublic void start()
Task.Dispatcherstart 在接口中 Task.Dispatcherpublic boolean isRunning()
Task.DispatcherisRunning 在接口中 Task.Dispatcherpublic void post(Runnable runnable)
Task.Dispatcherpost 在接口中 Task.Dispatcherpublic void post(int what,
Runnable runnable)
Task.Dispatcherpost 在接口中 Task.Dispatcherpublic void postDelay(Runnable runnable, long millis)
Task.DispatcherpostDelay 在接口中 Task.Dispatcherpublic void postDelay(int what,
Runnable runnable,
long millis)
Task.DispatcherpostDelay 在接口中 Task.Dispatcherpublic boolean has(int what)
Task.Dispatcherhas 在接口中 Task.Dispatcher@Deprecated public boolean has(Runnable runnable)
has 在接口中 Task.Dispatcherpublic void finish(Runnable runnable)
Task.Dispatcherfinish 在接口中 Task.Dispatcherpublic void shutdown()
Task.Dispatchershutdown 在接口中 Task.Dispatcher