从过去的两天开始,我正在用黑莓中的网络图像做列表字段,因为我是新手。我正在显示带有一些默认图像的列表字段。当我从网络下载实际图像时,它无法替换默认图像。我使用一个线程一张一张地加载图像。但是图像没有正确覆盖默认图像。请帮助me.Here 是我的列表字段代码。
public void drawListRow(ListField listField,final Graphics graphics,int index,
final int y, int width)
{
this.graphics=graphics;
this.inde=index;
class ImageDowload extends Task
{
void doTask()
{
load=new DowloadImage(picture[inde]);
if(load.getData()!=null)
{
_bmap=load.getBitmap();
graphics.drawBitmap(3,y+7,placeholder.getWidth(), placeholder.getHeight(),_bmap, 0, 0);
}
}
}
taskWorker.addTask(new ImageDowload());
String text=(String) get(listField, index);
String pricedetails=price[index];
graphics.setColor(rgb);
graphics.setFont(Utility.getBigFont(DConfig.getFSize()+4));
graphics.drawBitmap(3,y+7,placeholder.getWidth(), placeholder.getHeight(),placeholder, 0, 0);
graphics.drawText(text,100,y+25);
graphics.drawText(pricedetails+" $",420,y+25);
graphics.drawLine(0, y+74, DConfig.disWidth, y+74);
}