when I use AsyncTasks checking in the DDMS, the thread persist in memory as waiting thread after the onPostExecute() method, is that normal?. Here is a simplified Activity t
AsyncTask uses "thread pool" technique. Each AsyncTask you start gets into a queue; there are some idle threads in the "pool" (or they are created as needed up to a certain limit) waiting for tasks. An idle thread from the pool takes your AsyncTask and executes it, then returns to the pool. Then the process repeats until there are no more tasks in the queue.
This approach has 2 important features:
The thread which you see in DDMS after your AsyncTask finished is the idle thread in the pool.
Both the answers provided here are correct. In addition to that, the status of such threads in the pool will be "wait". This phenomenon could also be observed when using libraries like Okhttp which use connection pool for network operations.
yep this avoids the overhead of killing and restarting the thread when you submit the next AsyncTask
if you submit another AsyncTask after the first is completed the same thread will be reused for it