In general, I have RecyclerView , it displays CardView on a given layout. In a CardView layout, I have an EditText . The user can enter something there.
Under RecyclerView , I have a button, when I click this button, the method from the activity is called and in this method I need to get the data from the EditText each CardView .

How to implement it?

PS: I do not post the sample code, because in my opinion everything is clearly stated. Give me an idea, I'll take it further.

    1 answer 1

    1. In the adapter, get public List<String> editTextsTexts = new ArrayList<>(); (or an array if the number of cells in the list is static)
    2. In the adapter's onBindViewHolder method, hang the TextWatcher method on your EditText
    3. In the afterTextChange TextWatcher from item 2, update / assign the value to the corresponding list item from item 1 as follows: editTextsTexts.add(position, editable);
    4. Now you have a list that stores the text of all your EditText and is accessible from the adapter.
    5. You can get it in the activation way: ((ADAPTER_CLASS_NAME) recuclerView.getAdapter()).editTextsTexts;