AsyncTask, RejectedExecutionException and Task Limit
Posted
by Samuh
on Stack Overflow
See other posts from Stack Overflow
or by Samuh
Published on 2010-03-22T14:22:34Z
Indexed on
2010/03/22
15:41 UTC
Read the original article
Hit count: 515
I am fetching lots of thumbnails from a remote server and displaying them in a grid view, using AsyncTask. The problem is, my grid view displays 20 thumbnails at a time, so that creates 20 AsyncTasks and starts 20 executes, one per thumbnail.
I get RejectedExecution
exception in my code. 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?
Is there a way to increase this limit? Is it safe to just ignore this exception?(by having an empty catch(RejectedException e){}
block?)
I am running this code on Android 1.6 emulator and the API level in my code(minSDKVersion is 3). [EDIT: Added SDK and API level info]
© Stack Overflow or respective owner