Skip to content Skip to sidebar Skip to footer

Encountering Lag When Updating A Cardview Item In A Recycleview

i'm having an issue working with CardViews . I`ve created a CardView containing 1 TextView and 2 ImageViews , which gets displayed in an RecycleView . When i try to update the cont

Solution 1:

Well, i solved it. It seems to happen only when i'm loading the images via the XML method, if i load them with a 3rd party library like Picasso, the lag seems to dissapear. Something like :

Picasso.with(context).load(MovieDetails.getPoster())
            .error(R.drawable.placeholder)
            .placeholder(R.drawable.placeholder)
            .into(movieViewHolder.imageViewPoster);

inside the onBindViewHolder and instead of passing around bitmaps, just pass a String for the URL or location of the image. And pass the Context to the Adapter class.

Post a Comment for "Encountering Lag When Updating A Cardview Item In A Recycleview"