04-20-2010 11:00 PM
thanks to you all , i can step vy step
as last my post
i want to get image from server
simply, i just tested 17times loop
while( i++ < 17)
Field imageField = new WebBitmapField(url)
//Coderholic - Blackberry WebBitmapField
it returned : too many thread errror
finally i found "A single application can create up to 16 threads."
where should i turn off thread in webBitmapField
Solved! Go to Solution.
04-20-2010 11:57 PM
That class creates, for each field, a new Thread that does not exit until the image is downloaded or it encounters an error. You can't "turn off" the thread. Assuming that you are starting your loop with i==0, the problem is that you are creating 17 WebBitmapFields, and hence too many Threads, basically all at once.
I'd suggest that you write your own worker Thread that will load the images one after the other. Once finished, it can call back to the event thread with a Runnable to create normal BitmapFields using the (now-loaded) images. (Alternatively, it can do that for each image as it comes in.) You can use pieces of the WebBitmapField code as patterns for your own thread. (After all, Coderholic writes, "Feel free to use it," so go for it! )