title: How to properly get data from recyclerView to an Activity from which RV was set?
body: <p>I have an <code>Activity</code>, which has a <code>RecyclerView</code> and save <code>Button</code>. Each item (football match) of the <code>RecyclerView</code> contains some text (name of teams) and <code>EditText</code>, where user enters data (actually enters a score of the match). My goal is to save those scores to the list in the <code>Activity</code>, when user clicked on save button.</p>
  
  <p>I read the similar question (<a href="https://stackoverflow.com/questions/38918214/how-can-i-return-data-from-a-recyclerview-adapter">How can I return data from a RecyclerView adapter?</a>), the difference is that I need to get data from editText, not from checkBox(which is easy to check by clickListeners in <code>onBindViewHolder</code> method in <code>Adapter</code>)</p>
  
  <p>So I made it on my way and it's works. I implemented this method, which actually get particular item from <code>LinearLayoutManager</code> and then get data from <code>EditText</code> .</p>
  
  <pre class="lang-java prettyprint-override"><code>    private List&lt;Bet&gt; getNewUserBets() {
          View betView;
          Bet betItem;
          EditText userBet1;
          EditText userBet2;
  
          int numberOfMatches = rvMatchesAdapter.getItemCount();
          List&lt;Bet&gt; bets = new ArrayList&lt;&gt;();
  
          for (int i = 0; i &lt; numberOfMatches; i++)
          {
              betItem = rvMatchesAdapter.getItem(i);
              betView = linearLayoutManager.findViewByPosition(i);
              userScore1 = (EditText) betView.findViewById(R.id.result1);
              userScore2 = (EditText) betView.findViewById(R.id.result2);
              //here i checked whether the editText is empty and other stuff
              bets.add(betItem);
          }
          return bets;
      }
  </code></pre>
  
  <p>But I was wondering if I made this on a good way. In my opinion there are two approach:</p>
  
  <ol>
  <li><p>Separate logic. Implement a method in <code>Adapter</code> (probably in <code>onBindViewHolder</code>), which get data from <code>EditText</code>(entered by user). So logic about views should be in <code>Adapter</code>. And in <code>Activity</code> just call this method (like <code>getAdatper().</code>), when user presses a save button. So <code>Activity</code> doesn't know anything about views (what's is going on in <code>Adapter</code>).</p></li>
  <li><p>Like I did. Make whole logic in <code>Activity</code>, which in my opinion is worse than approach described at number 1.</p></li>
  </ol>
  
  <p>So in which way should I solve this task? And if 1 method is better, how should I get data from <code>EditText</code> directly from <code>Adapter</code>. Or maybe there is another approach(solution) to make this done. I would really appreciate any help.</p>