2017-04-24 1 views
0

재활용보기에서 이미지가 때때로 복제 된 것으로 보입니다. 중복 image.Not을 표시하는 이유는 무엇인가하여 screenn 당신이 이미지로드를 중지하는 데 사용할 수 있습니다 enter image description here중복 된 이미지가 안드로이드의 재활용보기에 표시됩니다.

+0

여기에 스크린 샷을 게시하십시오. –

+0

pictureLink가 다른 이미지에 연결되어 있습니까? – Christopher

+0

그것 때문에 imageloader 라이브러리, 빠른로드 –

답변

0
어댑터

콜백 onViewRecycled(ViewHolder holder)이 총에 내가 추가 한

public void onBindViewHolder(ViewHolder holder, int position) { 
     holder.tvSubject.setText(chatSessions.get(position).getName()); 
     holder.tvMessage.setText(chatSessions.get(position).getLastUnreadMsg()); 
     holder.tvTime.setText(chatSessions.get(position).getTime()); 

     final String pictureLink = ServerRequestHandler.getPictureLink(chatSessions.get(position).getCsToken()); 

     Log.d("ChatListAdapter", position + ", pictureLink= " + pictureLink); 
     Log.d("ChatListAdapter", chatSessions.get(position).getName() + ", Time= " + chatSessions.get(position).getTime()); 

     holder.profileLoadingView.setVisibility(View.GONE); 
     holder.profilePicture.setVisibility(View.VISIBLE); 
     holder.profilePicture.setImageDrawable(null); 

     if (TaskUtils.isNotEmpty(pictureLink)) { 

      imageLoader.displayImage((MainPageActivity) context, pictureLink, holder.profilePicture, holder.profileLoadingView); 
     } else { 
//   imageLoader.displayImage(null, holder.profilePicture, holder.profileLoadingView); 

//   holder.profilePicture.setImageDrawable(context.getResources().getDrawable(R.drawable.photo)); 


      holder.profilePicture.setImageDrawable(null); 
     } 

언젠가는 발생 시킬수 모든 시간 , 및/또는 이미 로더 이미지의 캐시를 소거 할 수있다. 이미지로드 라이브러리가 작동하는 방식과 방법을 확인해야합니다.

+0

캐시를 지우는 방법에 대한 아이디어가 없습니다. 당신은 예제 코드를 줄 수 –

+0

아니, 내가'imageLoader' 무엇인지 모르겠어. 또한 캐시가 범인이 아닐 수도 있습니다.이 콜백에서 이미지의로드 인을 취소해야합니다. – X3Btel

+0

다른 문제를 만듭니다 ... 다른 해결책이 있습니까? –

관련 문제