I run two AsyncTask tasks in my Android application which are from the same class but with different parameters. For example:
new myAsynckTask(a,b,c).execute
UPDATE: copied from Android Developers and initiated by Yazazzello
"This class was deprecated in API level 26.0.0-alpha1. Use AsyncTask directly."
You should use this for parallel execution:
AsyncTaskCompat.executeParallel(new AsyncTask() {
@Override
protected Data doInBackground(Param... params) {
return downloader.getData(params[0]);
}
@Override
protected void onPostExecute(Data response) {
processData(response);
}
}, param);