AsyncTask Cancel is not working

后端 未结 4 694
庸人自扰
庸人自扰 2021-01-20 02:46

I am learning how to cancel asyncTask so there is no uses on the code below.

I tried to called the asyncTask and execute it then cancel it and execute it.



        
4条回答
  •  北海茫月
    2021-01-20 03:24

    You can use either

    asynctask.cancel(true);
    

    or

    asyncTask.wait();
    

    "true " if the thread executing this task should be interrupted; otherwise, in-progress tasks are allowed to complete

提交回复
热议问题