title: How to disable auto update on scroll of a recyclerview?
body: <p>I am building an Ecommerce app where I need to select the quanitity on the recycleview for each items. And scrolling down after selecting the upward items , the recyclerview refreshes and put the the value 0 again. </p>
  
  <p>I need a very quick solution to that as I'm hanged in an ongoing project.</p>
  
  <pre><code>  public void readOrders()
  {
          final FirebaseUser firebaseUser = FirebaseAuth.getInstance().getCurrentUser();
          final DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReferenceFromUrl("https://kharkhowa-3b20d.firebaseio.com/items");
          databaseReference.addValueEventListener(new ValueEventListener() {
              @Override
              public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                  list.clear();
                  for (DataSnapshot dataSnapshot1 : dataSnapshot.getChildren()) {
                      ItemClass itemClass = dataSnapshot1.getValue(ItemClass.class);
                      assert itemClass != null;
                      assert firebaseUser != null;
                      list.add(itemClass);
                  }
                  Log.i("sizeeeeeeeeeeeee", String.valueOf(list));
                  itemAdapter = new ItemAdapter(getApplicationContext(), list);
                  recyclerView.setAdapter(itemAdapter);
                  recyclerView.addItemDecoration(new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL));
  
              }
  
  
              @Override
              public void onCancelled(@NonNull DatabaseError databaseError) {
  
              }
          });
  }
  </code></pre>
  
  <p>Adapter Class</p>
  
  <pre><code>public class ItemAdapter extends RecyclerView.Adapter&lt;ItemAdapter.ViewHolder&gt;{
  HashMap&lt;String, List&lt;String&gt;&gt; hm = new HashMap();
  Context context;
  private List&lt;ItemClass&gt; list ;
  int n, total = 0;
  
  public ItemAdapter(Context context, List&lt;ItemClass&gt; list) {
      this.context = context;
      this.list = list;
  }
  
  @NonNull
  @Override
  public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      View view = LayoutInflater.from(context).inflate(R.layout.items,parent,false);
      return new ItemAdapter.ViewHolder(view);
  }
  
  @SuppressLint("RestrictedApi")
  @Override
  public void onBindViewHolder(@NonNull final ViewHolder holder, int position) {
      // int n = 0;
  
          String s = "";
          final ItemClass itemClass = list.get(position);
          holder.itemName.setText(itemClass.getItemName());
          final String price = itemClass.getItemPrice();
          s = String.valueOf(n);
          holder.noOfitem.setText(s);
          holder.plus.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
                  String n1 = (String) holder.noOfitem.getText();
                  int i = Integer.parseInt(n1);
                  i = i + 1;
                  String s1 = String.valueOf(i);
                  holder.noOfitem.setText(s1);
                  //n++;
                  String ab = (String) holder.noOfitem.getText();
                  int b = Integer.parseInt(ab);
                  List&lt;String&gt; list = new ArrayList();
                  list.add(price);
                  list.add(ab);
                  hm.put(itemClass.getItemName(), list);
                  Log.i("hashhhhhhhhhh", hm.toString());
                  if (b == 1) {
                      total = total + 1;
                      Intent intent = new Intent("custom-message");
                      intent.putExtra("total", String.valueOf(total));
                      intent.putExtra("hashmap", hm);
                      LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
                  }
              }
          });
          holder.minus.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  String n1 = (String) holder.noOfitem.getText();
                  int i = Integer.parseInt(n1);
                  if (i &gt; 0) {
                      i = i - 1;
                      String s1 = String.valueOf(i);
                      holder.noOfitem.setText(s1);
                      String ab = (String) holder.noOfitem.getText();
                      int b = Integer.parseInt(ab);
                      List&lt;String&gt; list = new ArrayList();
                      list.add(price);
                      list.add(ab);
                      hm.put(itemClass.getItemName(), list);
                      Log.i("hashhhhhhhhhh", hm.toString());
                      if (b == 0) {
                          total = total - 1;
                          Intent intent = new Intent("custom-message");
                          intent.putExtra("total", String.valueOf(total));
                          intent.putExtra("hashmap", hm);
                          LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
                      }
                      //  n--;
                  }
              }
          });
  
  
  }
  
  @Override
  public int getItemCount() {
      return list.size();
  }
  
  
  public class ViewHolder extends RecyclerView.ViewHolder
  {
      public TextView itemName,noOfitem,cartnext;
      public ImageView minus,plus;
  
      public ViewHolder(View itemView) {
          super(itemView);
          itemName = (TextView)itemView.findViewById(R.id.itemname);
          noOfitem = (TextView)itemView.findViewById(R.id.noOfitem);
          minus = (ImageView)itemView.findViewById(R.id.minus);
          plus = (ImageView)itemView.findViewById(R.id.plus);
      }
  }
  </code></pre>
  
  <p>}</p>