//以application的onCreate中初始化任务为例
class app : Application() {
override fun onCreate() {
super.onCreate()
var taskCreator = TaskCreator.Builder().addTask(FirstTask())
.addTask(ThirdTask()).after(FirstTask::class.java,SecondTask::class.java, FourthTask::class.java)
.addTask(SecondTask()).after(FirstTask::class.java)
.addTask(FourthTask()).after(FirstTask::class.java)
.build()
StartTaskManager.addContextAndTask(taskCreator).addCompleteListener {
Log.d("StartTask:","complete")
}.start()
Log.d("StartTask:","Application onCreate complete")
}
}