text: android - How to prevent RecyclerView item from blinking after notifyItemChanged(pos)? - Stack Overflow
  I currently have a recycler view whose data updates every 5 secs. To update the data on the list, I am using
  notifyItemRangeChanged(position, mList.size());
  Each time I call notifyItemChanged(), the items on my recycler view update properly, however, it will blink because this causes onBindViewHolder to be called again. So it's as though it is a fresh load each time. How can I prevent this from happening, if possible?
  4,92299 gold badges4646 silver badges9797 bronze badges
  im using glide to load image, and try all answer to solve blinking but not working. then using Picasso solving the problem. and run smoothly – Muklas Aug 9 at 22:56
  RecyclerView has built in animations which usually add a nice polished effect. in your case you'll want to disable them:
  (The default recycler view animator should already be an instance of SimpleItemAnimator)
  edited Jun 30 at 8:17
  16.2k66 gold badges5252 silver badges9292 bronze badges
  yep! This is exactly what I needed. – portfoliobuilder Feb 22 '17 at 0:17
  but I think this also disables default animations of methods such as notifyItemInserted – user6650650 Feb 22 '17 at 0:21
  @user6650650 that works for me. And you are also correct. Thanks! – portfoliobuilder Feb 22 '17 at 0:29
  You can disable the item animations.
  this just seems to make the flickr faster than before, i'm using databinding. StableIds is sensible optimisation but you still have a flickr on the rows that are updating (they have radio button which change state but the rest of the view is unchanged so shouldn't filckr) – hmac Oct 29 at 15:21
  The problem may not come from animation but from not stable id of the list item.
  To use stable IDs, you need to:
  - setHasStableIds(true)
  In RecyclerView.Adapter, we need to set setHasStableIds(true); true means this adapter would publish a unique value as a key for item in data set. Adapter can use the key to indicate they are the same one or not after notifying data changed.
  - override getItemId(int position)
  Then we must override getItemId(int position), to return identified long for the item at position. We need to make sure there is no different item data with the same returned id.
  The source of solution for that is here.
  answered Jan 7 at 10:50
  6,36377 gold badges4141 silver badges7474 bronze badges
  this should be the accepted answer. the setAnimator to null is a hotfix and doesn't apply for those wants to use animation in their RecyclerView @portfoliobuilder – mochadwi Feb 20 at 9:10
  I read the below solution and implemented and it works fine on every device I tested.
  Clone Default animator class.
  In animateChange() method, comment below 3 lines,
  Set recyclerview item animator to that of your cloned class.
  //Note: I do understand how the solution works with not changing the alpha value of new holder but this is not my solution, I read this on stackoverflow itself but for some reason could not find it anymore. Sharing this to help out fellow developers.
  karan vskaran vs
  Use stableId in your adapter.
  Call adapter.setHasStableIds(true) and override getItemId(int position) method in your adapter class.
  Also, return some unique id from getItemId(int position) for each item. Don't just simply return position.
  In my case, neither any of above nor the answers from other stackoverflow questions having same problems worked.
  Well, I was using custom animation each time the item gets clicked, for which I was calling notifyItemChanged(int position, Object Payload) to pass payload to my CustomAnimator class.
  Notice, there are 2 onBindViewHolder(...) methods available in RecyclerView Adapter. onBindViewHolder(...) method having 3 parameters will always be called before onBindViewHolder(...) method having 2 parameters.
  Generally, we always override the onBindViewHolder(...) method having 2 parameters and the main root of problem was I was doing the same, as each time notifyItemChanged(...) gets called, our onBindViewHolder(...) method will be called, in which I was loading my image in ImageView using Picasso, and this was the reason it was loading again regardless of its from memory or from internet. Until loaded, it was showing me the placeholder image, which was the reason of blinking for 1 sec whenever I click on the itemview.
  Later, I also override another onBindViewHolder(...) method having 3 parameters. Here I check if the list of payloads is empty, then I return the super class implementation of this method, else if there are payloads, I am just setting the alpha value of the itemView of holder to 1.
  And yay I got the solution to my problem after wasting a one full day sadly!
  Here's my code for onBindViewHolder(...) methods:
  onBindViewHolder(...) with 2 params:
  public void onBindViewHolder(@NonNull RecyclerAdapter.ViewHolder viewHolder, int position) {
  .load(movie.getImageLink())
  .into(viewHolder.itemView.posterImageView);
  onBindViewHolder(...) with 3 params:
  holder.itemView.setAlpha(1);
  Here's the code of method I was calling in onClickListener of viewHolder's itemView in onCreateViewHolder(...):
  private void onMovieClick(int position, Movie movie) {
  data.putParcelable("movie", movie);
  // This data(bundle) will be passed as payload for ItemHolderInfo in our animator class
  notifyItemChanged(position, data);
  Note: You can get this position by calling getAdapterPosition() method of your viewHolder from onCreateViewHolder(...).