title: notifydatasetchanged not working from async task
body: <p>hi i think my issue is related to this <a href="https://stackoverflow.com/questions/24740557/notifydatasetchanged-not-working-on-recyclerview">notifyDataSetChanged not working on RecyclerView</a>
  im trying to refresh my layout from an async task but when im calling notify datasetchanged nothing happens, but if i create a new instance of the adapter and call notifydatasetchanged then it does work ive tried a few things to no avail and wonder what im doing wrong,</p>
  
  <p>i reference it like this </p>
  
  <pre><code> public ListAdapter cardAdapter;
  </code></pre>
  
  <p>then in onCreate i initialise everything to do with my recycler view, (the only bit thats needed here is how i initialise my adapter but for clarity ill add everything to do with my recycler view)</p>
  
  <pre><code>   staggeredGridLayoutManagerVertical = new 
     customLinearLayoutManager(this,customLinearLayoutManager.VERTICAL,false);
      recyclerView = (RecyclerView) findViewById(R.id.list_view);
      OnItemTouchListener itemTouchListener = new     
      FinalListActivity.OnItemTouchListener() {
          @Override
          public void onCardClick(View view, int position) {
              //removeAt(position);
              list.remove(position);
              cardAdapter.notifyItemRemoved(position);
          }
  
          @Override
          public void onCardLongClick(View view, int position) {
              //clearGrid();
          }
      };
      cardAdapter = new ListAdapter(list,this,itemTouchListener);
      recyclerView.setLayoutManager(staggeredGridLayoutManagerVertical);
      recyclerView.setItemAnimator(new DefaultItemAnimator());
      recyclerView.setAdapter(cardAdapter);
      //cardAdapter.notifyDataSetChanged();
  
      ItemTouchHelper.Callback callback =
              new SimpleItemTouchHelperCallback(cardAdapter);
      mItemTouchHelper = new ItemTouchHelper(callback);
      mItemTouchHelper.attachToRecyclerView(recyclerView);
  </code></pre>
  
  <p>if i add items to the list before these methods then my recycler view shows the information but what i want is to grab the information in an async task and populate the list in onPostExecute but when i call </p>
  
  <pre><code>cardAdapter.notifyDataSetChanged();
  </code></pre>
  
  <p>from onPostExecute nothing happens, any help?</p>
  
  <p><strong>EDIT</strong>
  adding the adapter</p>
  
  <pre><code>public class ListAdapter extends  
  RecyclerView.Adapter&lt;ListAdapter.MyViewHolder&gt; 
  implements ItemTouchHelperAdapter{
  private List&lt;String&gt; cardMakerList;
  private OnStartDragListener mDragStartListener;
  private FinalListActivity.OnItemTouchListener onItemTouchListener;
  
  public class MyViewHolder extends RecyclerView.ViewHolder{
      public EditText cardText;
      public ImageView close;
      public ContentLoadingProgressBar progress;
      public ImageView handleView;
      public RelativeLayout cardBack;
  
      public MyViewHolder(View view){
          super(view);
          cardText = (EditText) view.findViewById(R.id.cardText);
          close = (ImageView) view.findViewById(R.id.close);
          cardBack =(RelativeLayout)view.findViewById(R.id.cardLayout);
          close.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  onItemTouchListener.onCardClick(v, getPosition());
              }
          });
          /*
          close.setOnLongClickListener(new View.OnLongClickListener() {
              @Override
              public boolean onLongClick(View v) {
                  onItemTouchListener.onCardLongClick(v, getPosition());
                  return true;
              }
          });
          */
          progress = (ContentLoadingProgressBar)  
          view.findViewById(R.id.progress);
          handleView = (ImageView)view.findViewById(R.id.handle);
      }
  
  }
  public ListAdapter(List&lt;String&gt; cardMakerList,OnStartDragListener 
  dragStartListener,FinalListActivity.OnItemTouchListener onItemTouchListener) 
  {
      this.cardMakerList = cardMakerList;
      mDragStartListener = dragStartListener;
      this.onItemTouchListener = onItemTouchListener;
  }
  @Override
  public boolean onItemMove(int fromPosition, int toPosition) {
      if (fromPosition &lt; toPosition){
          for (int i = fromPosition; i &lt; toPosition; i++){
              Collections.swap(cardMakerList,i,i+1);
          }
      }else{
          for (int i = fromPosition; i &gt; toPosition; i--){
              Collections.swap(cardMakerList,i,i-1);
          }
      }
      notifyItemMoved(fromPosition,toPosition);
      return true;
  }
  @Override
  public void onItemDismiss(int position) {
      cardMakerList.remove(position);
      notifyItemRemoved(position);
  }
  @Override
  public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType){
      View itemView = LayoutInflater.from(parent.getContext())
              .inflate(R.layout.card_view_holder, parent, false);
      return new MyViewHolder(itemView);
  }
  
  @Override
  public void onBindViewHolder(final MyViewHolder holder, final int position)  
  {
      String cardString = cardMakerList.get(position);
      holder.cardText.setText(cardString);
      holder.handleView.setOnTouchListener(new View.OnTouchListener() {
          @Override
          public boolean onTouch(View v, MotionEvent event) {
              if (MotionEventCompat.getActionMasked(event) ==
                      MotionEvent.ACTION_DOWN) {
                  mDragStartListener.onStartDrag(holder);
              }
              return false;
          }
      });
      holder.close.setOnTouchListener(new View.OnTouchListener() {
          @Override
          public boolean onTouch(View v, MotionEvent event) {
              //cardMakerList.remove(position);
              return false;
          }
      });
  }
  @Override
  public int getItemCount(){
      return cardMakerList.size();
  }
  }
  </code></pre>