How to run the same asynctask more than once?

前端 未结 12 2043
难免孤独
难免孤独 2020-12-01 03:32

I have my asyncTask run when the activity first starts, then if network connectivity is not available then i have a refresh button that tries to run the asyncTask to try aga

12条回答
  •  -上瘾入骨i
    2020-12-01 03:57

    Just like threads, AsyncTasks can't be reused. You have to create a new instance every time you want to run one.

提交回复
热议问题