-
Notifications
You must be signed in to change notification settings - Fork 64
Carlyle-Lee edited this page May 11, 2020
·
7 revisions
TM is TaskManager for short. It encapsulated some API of TaskManger, so that there is no need to call TaskManager.getInstance each time. For more advanced apis you may need to refer to TaskManager.
public static void triggerEvent(Object group, int event, Object data)
Trigger an event, any task which is watching the group event , will be notified and with data been dilivered. Task will be executed if there is no other dependences.
触发一个局部事件。依赖这个事件的任务将会收到这个事件和数据。若无其他依赖条件,任务将被触发执行。
public static void triggerEvent(int event)
Trigger an event, any task which is watching this global event , will be notified.
触发一个全局事件。依赖这个事件的任务将会收到这个事件。
// task be posted to run
new Task(){
@Override
public void doTask() {
// do sth
}
}.dependOn(R.id.event_vv)
.postAsync();
// Trigger task to run
TM.triggerEvent(R.id.event_vv);