我用函数来显示图片:加载图片显示加载进度
Bitmap imageBitmap = loadBitmap(URL);
loadBitmap()如下:
private Bitmap loadBitmap(String url) {
try {
Bitmap bm = BitmapFactory.decodeStream((InputStream)this.fetch(url));
return bm;
}
catch(Exception e) {
e.printStackTrace();
return null;
}
}
及以下取():
public Object fetch(String address) {
try {
URL url = new URL(address);
Object content = url.getContent();
return content;
}
catch(Exception e) {
e.printStackTrace();
}
return this;
}
我要在加载时显示加载进度或load.png。 并以图片加载结束并显示。 我该怎么办? 我尝试使像ProgressDialog。 但我不知道如何使用?