title: Update recyclerView adapter data in second tab, from the first tab
body: <p>i have an <code>Activity</code> which has two tabs. Each tab has a <code>RecyclerView</code> and each <code>RecyclerView</code> has a specific <code>Adapter</code>. there is a button in each dataset of first tabs <code>RecyclerView</code> that deletes dataset in position and adds it to the next tab. My problem is that I should exit from <code>Activity</code>and enter again to see the added data in second tab. how can I update second tab immediately ? </p>
  
  <pre><code> public class QCRepairAdapter extends RecyclerView.Adapter&lt;QCRepairAdapter.MyViewHolder&gt; {
  
      private LayoutInflater inflater;
      List&lt;QCInfo&gt; data = Collections.emptyList();
  
      public QCRepairAdapter(Context context, List&lt;QCInfo&gt; data) {
  
          inflater = LayoutInflater.from(context);
          this.data = data;
  
      }
  
      @Override
      public QCRepairAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
  
          View view = inflater.inflate(R.layout.cards_qc_repair, parent, false);
  
          MyViewHolder holder = new MyViewHolder(view);
  
          return holder;
  
      }
  
      public void Delete(int position) {
          data.remove(position);
          notifyItemRemoved(position);
      }
  
      @Override
      public void onBindViewHolder(final QCRepairAdapter.MyViewHolder holder, final int position) {
  
          QCInfo current = data.get(position);
          holder.projectName.setText(current.projectName);
          holder.code.setText(current.code);
          holder.operator.setText(current.operatorName);
  
      }
  
      @Override
      public int getItemCount() {
          return data.size();
      }
  
      class MyViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
  
          TextView projectName;
          TextView code;
          TextView operator;
          ImageView btn_accept;
  
          public MyViewHolder(final View itemView) {
              super(itemView);
              projectName = (TextView) itemView.findViewById(R.id.tv_card_qc_repair_name);
              code = (TextView) itemView.findViewById(R.id.tv_card_qc_repair_code);
              operator = (TextView) itemView.findViewById(R.id.tv_card_qc_repair_operatorName);
              btn_accept = (ImageView) itemView.findViewById(R.id.iv_card_qc_repair_accept);
              btn_accept.setOnClickListener(this);
          }
  
          @Override
          public void onClick(View v) {
  
                  showDialog(v.getContext(), "تایید فرآیند ؟", "qcAccept", code.getText().toString(), getPosition());
  
          }
      }
  
      private void showDialog(final Context context, String message, final String method, final String code, final int position) {
          AlertDialog.Builder builder = new AlertDialog.Builder(context);
          builder.setTitle("هشدار")
                  .setIcon(R.drawable.alert)
                  .setMessage(message)
                  .setPositiveButton("بله", new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialog, int which) {
                          BackgroundTask backgroundTask = new BackgroundTask(context);
                          backgroundTask.execute(method, code);
                          Delete(position);
                      }
                  })
                  .setNegativeButton("خیر", new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialog, int which) {
  
                      }
                  })
                  .create().show();
      }
  }
  </code></pre>