我使用下面的函数来显示图像:
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;
}
}
fetch() :
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,但是如何使用呢?