I have an AsyncTask inside one of my class. I am executing the AsyncTask like:
mAsyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
When I debug my app the mAsyncTask's onPreExecute() function is called correctly, but the doInBackground function is not called. What can cause the problem?
PlanRouteAsync Code:-
private class PlanRouteAsync extends AsyncTask<Void, Integer, Void>{
@Override
protected void onPreExecute(){
super.onPreExecute();
mIsRunning = true;
}
@Override
protected Void doInBackground(Void... params){
...
return null;
}
@Override
protected void onProgressUpdate(Integer... values){
super.onProgressUpdate(values);
...
}
@Override
protected void onCancelled(){
super.onCancelled();
...
}
@Override
protected void onCancelled(Void aVoid){
super.onCancelled(aVoid);
....
}
@Override
protected void onPostExecute(Void aVoid){
super.onPostExecute(aVoid);
....
}
}
This is a company app, several AsyncTask is running in the background, but i have read, that the executeOnExecutor function should execute the asycnTask parallel.
I have read these posts also, but they didn't help:
Android SDK AsyncTask doInBackground not running (subclass)
EDIT:
My build.gradle file:
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
minSdkVersion 18
targetSdkVersion 23
}
}
dependencies {
compile project(':mPChartLib')
compile project(':sVGSupport')
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:1.0.4'
}