Permalink
Browse files

Fixing java.util.concurrent.RejectedExecutionException

Fixing a crash when a download task is rejected from the tread pool.
1 parent a38a4e7 commit df0e46356e375e5d9afbdfc9bd648e2fcc6a83e6 @dglinenko dglinenko committed Jan 17, 2014
@@ -666,7 +666,15 @@ protected void onPostExecute(final Void result) {
for (UrlDownloader downloader: mDownloaders) {
if (downloader.canDownloadUrl(url)) {
- downloader.download(context, url, filename, loader, completion);
+ try {
+ downloader.download(context, url, filename, loader, completion);
+ } catch (Exception e) {
+ clog("Can't download from url: " + url + " Exception: " + e.getMessage());
+ mPendingDownloads.remove(url);
+ if (imageView != null) {
+ mPendingViews.remove(imageView);
+ }
+ }
return;
}
}

0 comments on commit df0e463

Please sign in to comment.