When you use new Thread
you’re really creating a new thread every time you execute that. AsyncTask
however, uses a static pool of max 128 threads and will reuse an old thread whenever it exists. So, running AsyncTask 10 times in serial will only create one thread that runs the task 10 times instead of 10 threads.
That’s one of the differences among many.
Related Contents:
- Running multiple AsyncTasks at the same time — not possible?
- Handler vs AsyncTask vs Thread [closed]
- Android AsyncTask threads limits?
- Asynctask vs Thread in android
- Android SDK AsyncTask doInBackground not running (subclass)
- AsyncTask threads never die
- Android “Only the original thread that created a view hierarchy can touch its views.”
- Service vs IntentService in the Android platform
- ProgressDialog in AsyncTask
- Using AsyncTask
- What is the purpose of Looper and how to use it?
- How to run a Runnable thread in Android at defined intervals?
- AsyncTask won’t stop even when the Activity has destroyed
- How to execute Async task repeatedly after fixed time intervals
- Timertask or Handler
- Android Fragments. Retaining an AsyncTask during screen rotation or configuration change
- Android AsyncTask for long running operations
- Difference between Service, Async Task & Thread?
- Android HTML ImageGetter as AsyncTask
- Is a RelativeLayout more expensive than a LinearLayout?
- Show ProgressDialog Android
- java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
- How to pause/resume thread in Android?
- Why are most UI frameworks single threaded?
- How can I run code on a background thread on Android?
- running parallel AsyncTask
- How to use AsyncTask to show a ProgressDialog while doing background work in Android? [duplicate]
- Making the Android emulator run faster
- getting context in AsyncTask
- ProgressDialog not shown when AsyncTask.get() called [duplicate]
- Android: When should I use a Handler() and when should I use a Thread?
- AsyncTaskLoader vs AsyncTask
- How to stop a thread?
- Accessing UI thread handler from a service
- Example: Android bi-directional network socket using AsyncTask
- How to show toast in AsyncTask in doInBackground
- Android custom view group delegate addView
- How to run an async task for every x mins in android?
- Executing Multiple AsyncTask’s Parallely
- Android xml vs java layouts performance
- How do you use a TimerTask to run a thread?
- How do I retrieve the data from AsyncTasks doInBackground()?
- Start a service in a separate process android
- “No enclosing instance of type” error while calling method from another class in Android
- Inflate a view in a background thread
- Android: How to return async JSONObject from method using Volley?
- Webview with asynctask on Android
- How to create a Looper thread, then send it a message immediately?
- Invalid heap address and fatal signal 11
- Application threads vs Service threads