AsyncTask Cancel is not working

后端 未结 4 764
庸人自扰
庸人自扰 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:49

    To cancel a AsyncTask call the below line.

    asyncTask.cancel();
    

    onCancelled() is a override method that is executed when ever cancel is called.

提交回复
热议问题