java - IllegalThreadState exception while asynchronous list field implementation in Blackerry -
this question continuation previous question on stack overflow how-to-download-images-asynchronously-from-web-server . struggling make asynchronous list in blackberry. working fine me. giving me problem now.
what have done far
- created list view taking value xml feed
- list loaded default thumbnail
- created
runnablefactory
, limiting thread pool size 5 , adding runnable's it. runnable objects has capability download image server. - now list loads fine asynchronously.
problem scenario
on loading of list screen initializing runnablefactory
, starting download , render images in list. but, let have 50 number of rows in list. , 10 images downloaded successfully, , runnablefactory still in action. @ point press key , click next. practically should come list screen , again initiate download process freshly. throwing illegalthredstate exception
my assumptions on problem
as threads running, might have cancel of threads on key pressed. if problem can please let me know how it? have created multiple threads how manage stop threads , navigate ?
this looks more complex system. can me understand else possible fix problem?
if using treadpool shutdown otherwise can inturupt treads on navigate back.
Comments
Post a Comment