title: How to get data from all RecyclerView EditTexts
body: <p>I have a RecyclerView in my app which contains two buttons.One adds an item (two EditTexts) to the RecyclerView, and the other is for getting the values entered in the EditTexts and sending them to another activity.<br>
  The number of items in the RecyclerView are based on user's needs. And I don't know how to get All the values user entered in those EditTexts and send them to another activity.<br>
  (the EditTexts only get numberDecimal type and i want to do some math on the values)  </p>
  
  <p><strong>Update:</strong> Added EntryData and MainActivity Classes.</p>
  
  <p><strong>Adapter:</strong>  </p>
  
  <pre><code>public class DataAdapter extends RecyclerView.Adapter&lt;DataAdapter.DataViewHolder&gt; {
      private Context context;
      private List&lt;EntryData&gt; datas = new ArrayList&lt;&gt;();
  
      @Override
      public DataViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
          View view = layoutInflater.inflate(R.layout.item_surface, parent, false);
          return new DataViewHolder(view);
      }
  
      @Override
      public void onBindViewHolder(DataViewHolder holder, int position) {
          holder.bindData(datas.get(position));
      }
  
      @Override
      public int getItemCount() {
          return datas.size();
      }
  
      public static class DataViewHolder extends RecyclerView.ViewHolder {
          private EditText lengthEditText;
          private EditText diameterEditText;
          public DataViewHolder(View itemView) {
              super(itemView);
              lengthEditText = itemView.findViewById(R.id.tv_item_length);
              diameterEditText = itemView.findViewById(R.id.tv_item_diameter);
          }
          public void bindData(EntryData entryData) {
              lengthTextView.setText(entryData.getLength());
              diameterTextView.setText(entryData.getDiameter());
          }
      }
      public void addData(EntryData entryData) {
          datas.add(entryData);
          notifyItemInserted(datas.size() - 1);
      }
  }  
  </code></pre>
  
  <p><strong>EntryData Class:</strong>  </p>
  
  <pre><code>    public class EntryData {
  
      private String length;
      private String diameter;
  
      public String getLength() {
          return length;
      }
  
      public void setLength(String length) {
          this.length = length;
      }
  
      public String getDiameter() {
          return diameter;
      }
  
      public void setDiameter(String diameter) {
          this.diameter = diameter;
      }
  }
  </code></pre>
  
  <p><strong>MainActivity</strong>  </p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          setupViews();
      }
  
      private void setupViews() {
          RecyclerView recyclerView= findViewById(R.id.rv_main_data);
          recyclerView.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
          final DataAdapter adapter= new DataAdapter();
          recyclerView.setAdapter(adapter);
          Button addDataButton = findViewById(R.id.btn_main_addData);
          addDataButton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  EntryData entryData = new EntryData();
                  adapter.addData(entryData);
              }
          });
      }
  }
  </code></pre>
  
  <p><strong>item_surface.xml:</strong>  </p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      xmlns:tools="http://schemas.android.com/tools"
      android:orientation="horizontal"
      android:layout_weight="2"&gt;
  
      &lt;EditText
          android:id="@+id/tv_item_length"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:hint="length"
          android:gravity="center"
          android:layout_marginTop="4dp"
          android:inputType="numberDecimal"
          android:layout_marginLeft="4dp"
          android:layout_marginRight="2dp"
  
          android:layout_weight="1"/&gt;
      &lt;EditText
          android:id="@+id/tv_item_diameter"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:inputType="numberDecimal"
          android:hint="diameter"
          android:gravity="center"
          android:layout_marginTop="4dp"
          android:layout_marginRight="4dp"
          android:layout_marginLeft="2dp"
  
          android:layout_weight="1"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>