AsyncTask, RejectedExecutionException and Task Limit

I recall reading somewhere that there
is a limit to number of tasks that
AsyncTask can have in its queue at a
time, i might be hitting that. Was
this bar lifted?

AsyncTask appears to presently support 10 threads and a work queue depth of 10. In theory, that would just support 20 items…if nothing else is using AsyncTask.

Is there a way to increase this limit?

Grab the source code, modify it, put it in your own package, and use that one. I did this with my AsyncTaskEx, though that is based on the Android 1.5 source.

Is it safe to just ignore this
exception?

Your work will not be queued for execution. Whether that is “safe” is up to you. I am not aware of any other impacts on the AsyncTask infrastructure.

Leave a Comment