"지연 이미지 로더"를 통해 이미지 뷰에 대화 상자에 이미지를로드하려고합니다. 내가 호출하는 방법을 보여주기 위해 두 개의 코드 스 니펫을 포함했습니다.대화 상자에 이미지 및 디스플레이 다운로드
---- 편집 -----
이제 보편적 인 이미지 로더 1.8.6
Log.i(Utils.TAG, "Show Photo");
ImageLoader imgLoader = new ImageLoader(a);
imgLoader.DisplayImage(strUrl, image);
을 @TalhaQ 방법 didn를하기 때문에 내가 그것을 전화 했어 방법이 있습니다 사용 ' 일하지 마라. 내가 그 URL로 이동 때 PARAMATERS
---- 원본과 동일한 수를 허용하지 않았다 --- 로그 고양이는 유효한 URL과 이미지를 보여줍니다. 어떤 아이디어?
Utils.java
public Dialog openFeed(final Activity a, final long id) {
final Dialog dialog = new Dialog(a);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.getWindow().getAttributes().windowAnimations = R.style.dialog_animation;
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.feed_item);
//Set the Title & Descr to the Item Selected
TextView title = (TextView) dialog.findViewById(R.id.txtItemTitle);
title.setText(strTitle);
TextView descr = (TextView) dialog.findViewById(R.id.txtItemDescription);
descr.setText(strDescr);
ImageView image = (ImageView) dialog.findViewById(R.id.imgFeedImage);
Log.i(TAG, "strUrl: " + a.getResources().getString(R.string.photoURL) + strUrl);
ImageLoader imageLoader = new ImageLoader(a);
imageLoader.DisplayImage(a.getResources().getString(R.string.photoURL) + strUrl, image);
Button CommentButton = (Button) dialog.findViewById(R.id.dialogButtonComment);
// if button is clicked, close the custom dialog
CommentButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
final AlertDialog addComment = Utils.openComments(a, id);
addComment.show();
}
});
XML : 나는 또한 제대로 컨텍스트를 통과하지 생각 Loader.I 같은 게으른 이미지를 사용하고
<ImageView
android:id="@+id/imgFeedImage"
android:layout_width="wrap_content"
android:layout_height="200dp"
android:layout_alignLeft="@+id/txtItemDescription"
android:layout_alignRight="@+id/txtItemDescription"
android:layout_below="@+id/txtItemDescription"
android:contentDescription="@string/itemicon"
android:src="@drawable/gplus"
android:scaleType="fitCenter"
android:maxHeight="200dp"
android:visibility="invisible" />
당신이 당신의 로그 고양이 오류를 게시 할 수있는 활동 runOnUiThread()과 유사, UI 스레드의 메시지 큐에 Runnable를 게시하려면? –
로그캣 오류가 없습니다. 단지 이미지를 다운로드하고 표시하지 않습니다. – jcaruso