Amrmsmb
Amrmsmb

Reputation: 11398

How to use AsyncTask.executeOnExecutor()

I have an Asynctask and I want in the onPostExecute of that AsyncTask to execute another Asynctask.

my question is how can I use AsyncTask.executeOnExecutor() in this case?

Upvotes: 0

Views: 1218

Answers (2)

M D
M D

Reputation: 47817

Create a separate class of AsyncTask and execute like

    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
        task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    else
        task.execute();

task is an Object of AsyncTask

Upvotes: 1

Hasanaga
Hasanaga

Reputation: 1098

AsyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);

Upvotes: 0

Related Questions