I'm using AsyncTask
s to fetch data in response to the user pressing a button. This works well and keeps the interface responsive while fetching the data, but when I checked out what was going on in the Eclipse debugger, I found out that every time a new AsyncTask
was created (which is quite often, because they can only be used once), a new thread was being created but never terminated.
The result is a large number of AsyncTask
threads just sitting there. I'm not sure if this is a problem in practice or not, but I'd really like to get rid of those extra threads.
How can I kill these threads?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…