Cardview with multiple images

0

Can anyone help me how do I make each card change the images using the picasso library?

    
asked by anonymous 30.01.2018 / 00:43

1 answer

2

Try on the onBindViewHolder that in the example below, will not work. But I think there are better performance alternatives.

  @Override
public void onBindViewHolder(MovieViewHolder holder, int position) {

        //holder.mTextViewTitle.setText(mMovies.getJSONObject(position).get("id").toString());
        holder.mTextViewTitle.setText(mMovies.get(position).getmTitle());

        holder.idItem = mMovies.get(position).getmId();


        Picasso.with(holder.context).load("http://image.tmdb.org/t/p/w500/" +
            mMovies.get(position).getmPosterPath())
            .into(holder.mMovieImageView);

}
    
01.02.2018 / 15:05