AsyncTask ; doInbackground() not called after calling method onPreExecute()

前端 未结 4 1275
星月不相逢
星月不相逢 2021-02-01 03:34

I did added async library at my project and checked already, I don\'t know why code flow doesn\'t go in to asynctask

Code

public void doMysql()
{
    Log         


        
4条回答
  •  遥遥无期
    2021-02-01 04:27

    I was in the same situation.

    1. I made a call AsyncTask.cancel(boolean mayInterruptIfRunning) passing true
    2. Then I assumed (I was wrong) that the doInBackground() of this task was now interrupted

    By adding logs statements I realised that the very first asyncTask was still running ... thus preventing another asyncTask to execute. It's doInBackground() method was running an infinite while loop so I simply had to change condition to consider all the possible "break" cases...

提交回复
热议问题