title: recyclerview notifyDataSetChanged() is not working
body: <p>I am trying to update myadapter using notifyDataSetchanged() in updateList().But not working for recyclerview. I can able to see list size in updateList() and its displaying actual result but only reclerview is not updating.This class was designed in MVVM Design Pattern.</p>
  
  <pre><code>   public class TasksAdapter extends RecyclerView.Adapter&lt;TasksAdapter.TasksAdapterViewHolder&gt; {
          private static final String TAG =  TasksAdapter.class.getSimpleName();
          static ArrayList&lt;ItemModel&gt; list;
          static Context mContext;
          private Fragment fragment;
          private int row_index = -1;
          private SessionManager session;
      //    SelectColorVM colorVM;
  
          public TasksAdapter(Fragment fragment, Context context, ArrayList&lt;ItemModel&gt; itemList) {
              this.mContext = context;
              this.list = itemList;
              this.fragment = fragment;
              session = new SessionManager(fragment.getContext());
          }
  
          public void updateList(ArrayList&lt;ItemModel&gt; itemList){
              list.clear();
              this.list = itemList;
              notifyDataSetChanged();
          }
  
          @Override
          public TasksAdapterViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
              TasksItemBinding binding =
                      DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.tasks_item,
                              parent, false);
              return new TasksAdapter.TasksAdapterViewHolder(binding);
          }
  
          @Override
          public void onBindViewHolder(TasksAdapterViewHolder holder, final int position) {
              holder.binding.setViewModel(list.get(position));
              if(position == 0 &amp;&amp; list.get(position).btnText.get().toString().length() &gt; 0)
                  holder.binding.btnUpdate.setVisibility(View.VISIBLE);
              else
                  holder.binding.btnUpdate.setVisibility(View.INVISIBLE);
              holder.binding.layoutItem.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View view) {
      //                row_index = position;
      //                notifyDataSetChanged();
                      Fragment fragment = new DetailFragment();
                      FragmentManager manager = ((FragmentActivity) mContext).getSupportFragmentManager();
                      FragmentTransaction fragmentTransaction = manager.beginTransaction();
                      Bundle bundle = new Bundle();
                      ItemModel item = list.get(position);
                      bundle.putSerializable("item", item);
                      fragment.setArguments(bundle);
                      fragmentTransaction.replace(R.id.id_frame, fragment, "details");
                      fragmentTransaction.addToBackStack("details");
                      fragmentTransaction.commit();
                  }
              });
              holder.binding.btnUpdate.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View view) {
                      HashMap&lt;String, String&gt; user = session.getUserDetails();
                      if(list.get(position).btnText.get().equals("Task Start")){
                          LandingEngine.updateStatusAndSetStartTimeForRequest(fragment, user.get(SessionManager.KEY_CLEANER_ID), list.get(position).sid.get().toString());
                      } else if(list.get(position).btnText.get().equals("Task Complete")){
                          LandingEngine.updateStatusAndSetCompleteTimeForRequest(fragment, user.get(SessionManager.KEY_CLEANER_ID), list.get(position).sid.get().toString());
                      }
                  }
              });
          }
  
          @Override
          public int getItemCount() {
              return list.size();
          }
  
          public static class TasksAdapterViewHolder extends RecyclerView.ViewHolder {
              TasksItemBinding binding;
  
              public TasksAdapterViewHolder(TasksItemBinding rowbinding) {
                  super(rowbinding.getRoot());
                  this.binding = rowbinding;
              }
  
          }
          @Override
          public long getItemId(int position) {
              return position;
          }
  
          @Override
          public int getItemViewType(int position) {
              return position;
          }
  
  
      }
  </code></pre>
  
  <p>I am calling adapter from my fragment like below</p>
  
  <pre><code>if(list.size() &gt; 0) {
              if(adapter == null) {
                  view.setHasFixedSize(true);
                  mLayoutManager = new LinearLayoutManager(fragment.getContext());
                  view.setLayoutManager(mLayoutManager);
                  adapter = new TasksAdapter(fragment, fragment.getContext(), list);
                  view.setAdapter(adapter);
                  view.addItemDecoration(new DividerItemDecoration(fragment.getContext()));
              } else {
                  adapter.updateList(list);
  //                view.getAdapter().notifyDataSetChanged();
  //                view.invalidate();
              }
          }
  </code></pre>
  
  <p>Please check this and let me know where i am doing wrong here.Thanks in advance..</p>