What happens is, I am fetching the data from web service. Simultaneously 6 async tasks are running to get 6 different things. The problem is When first async task starts executing and I log out, and when I log in with different user, the first async task doesn’t execute again. Am i forgetting something or it is this way only. How can I make the first async task execute again.?
Share
No, you can’t reuse your
AsyncTask. If you callexecute()on the sameAsyncTasktwice, an exception will be thrown.AsyncTasks are often specific to anActivityand aren’t meant for long-term operations (such continuously fetching data from a web service). If you want your data to be fetched after exiting the activity, you’ll need to use aServiceinstead.