此图像显示损坏。在所有下载过程中,它只会偶尔发生一次。我需要一些建议来克服和解决此问题
String fullUrl = ServerUrl + DomainConstantValues.IMAGE_LOCATION_POST + postImage.getPost_id() + "/" + postImage.getImage_path();
Log.d("getReceveiver", "DownloadImagesPost: url " + fullUrl);
//Download Image from URL
InputStream input = new java.net.URL(fullUrl).openStream();
Log.d("getReceveiver", "DownloadImagesPost: " + input);
//Decode Bitmap
bitmap = CommonFunctions.readBitmapFromByte(input);
if (bitmap == null) {
Log.d("getReceveiver", "DownloadImagesPost: ");
}
public static Bitmap readBitmapFromByte(InputStream input) {
if (input != null) {
Bitmap bitmap = BitmapFactory.decodeStream(input);
return bitmap;
}
return null;
}