为什么一个
AsyncTask
只能执行一个任务?例如,task = new SubAsyncTask(...); // assume the parameter is correct.
task.execute(...) //
task.execute(...)// calling once again, it throws exeception.
但是一个 Handler
可以持续执行多个任务:
hd = new Handler(...); // assume the parameter is correct
hd.sendMessage(...); //
hd.sendMessage(...);// no exeception is thrown.
AasyncTask
对象只适用于一次性任务吗?如果我不想为类似的任务创建多个对象,我应该选择Handler
吗?