이미지 형식 인터넷을 가져 오는 데 문제가 있습니다. 커스텀 레이아웃 이미지 뷰와 텍스트 뷰가있는리스트 뷰가 있습니다. 제 경우에는 주어진 blow 함수를 사용하여 이미지 양식 인터넷을 가져 오는 중이지만 큰 이미지가 올 때 비트 맵 크기 예외가 발생합니다이 발생합니다.이미지 형식을 가져올 때 비트 맵 크기 예외가 발생합니다. 인터넷
private static InputStream fetch(String urlString)
throws MalformedURLException, IOException {
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet request = new HttpGet(urlString);
HttpResponse response = httpClient.execute(request);
return response.getEntity().getContent();
}
Resources res;
// *********** Function For Fetching Image form Internet
public static Drawable LoadImage(String URL, BitmapFactory.Options options) {
try {
if (fetch(URL) != null) {
try {
InputStream obj = fetch(URL);
bmp = BitmapFactory.decodeStream(obj, null, options);
obj.reset();
} catch (Exception e) {
}
Drawable drawable = new BitmapDrawable(bmp);
return drawable;
} else {
bitmap = BitmapFactory.decodeResource(
TennisAppActivity.mContext.getResources(),
R.drawable.profileplaceholder);
Drawable drawable = new BitmapDrawable(bitmap);
return drawable;
}
} catch (Exception e) {
Log.e("GUIMethodClasas", "fetchDrawable failed", e);
return null;
}
}
인터넷에서 이미지를 가져 오는 데 위의 코드를 사용하고 있습니다. 제발 어떤 친구 나에게 가능한 한 빨리 솔루션을 제공하십시오.
"큰 이미지"를 정의하십시오. 크기? 치수? 스택 트레이스? – WarrenFaith
이것은 내가 추측하고 있지만 큰 이미지로만 충돌하는 일부 이미지와 함께 작동합니까? 나는 갤러리에서 큰 이미지를 선택할 때 유사한 에러를 막기 위해 이미지 리사이징과 비슷한 코드를 가지고있다. – DeliveryNinja