I have a little problem with some Async tasks that are running in my Android app. Due to the fact that I'm using some kind of network IO, it may someday take longer than expected and block the execution of other async tasks.
I need to keep my target and minimum sdk versions, but they are aimed at targetSdkVersion = "15" with minSdkVersion = "8". I require that when I call the Async task, I can check the SDK of the devices and, if it is more than 11, it can call executeOnExecutor (), and not just execute, to allow the device to run them in parallel and prevent this blocking operation.
Although I have a target SDK of 15, the device I am using has a SDK of 17.
However, when called:
MyAsyncTask(this).executeOnExecutor();
I get the error message โThe executeOnExecutor () method is undefined for the typeโ and the only option available to me is:
MyAsyncTask(this).execute();
MyAsyncTask is a class object that extends AsyncTask and overloads the standard methods onPreExecute, doInBackground, onProgressUpdate, and onPostExecute.
I tried following the tips given here ... http://steveliles.imtqy.com/android_s_asynctask.html
source share