Can't stop/restart AsyncTask

后端 未结 3 1487
执笔经年
执笔经年 2021-01-24 01:36

Please help. I can restart the AsyncTask. App crashes every time, when second call to updatePoi().

Here is my code:

  1. I\'m checking status of task and set

3条回答
  •  一生所求
    2021-01-24 02:09

    You can't restart a task. Each task object may only be executed once:

    The task can be executed only once (an exception will be thrown if a second execution is attempted.)

    So create a new object each time you execute it, don't use the same object.

提交回复
热议问题