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 getRejectedExecutionexception 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 emptycatch(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]


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?

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

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 myAsyncTaskEx, 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 theAsyncTaskinfrastructure.


更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. 判断Android设备是否连接网络
  2. Android中简单的音乐播放器
  3. Android文件递归遍历
  4. android 不使用布局文件,完全由代码控制布
  5. Android 分享微信小程序
  6. Android:Timer定时器
  7. Android ExpandableListView 带有Checkbo
  8. Android应用程序启动过程源代码分析(2)
  9. 节操视频播放器
  10. Android中如何自定义view