How can I retrieve the value from all EditTexts created by the RecyclerView in MainActivity?
In my RecyclerView Adapter I'm extending my inner class:
public class MyPersonalAdapter extends RecyclerView.Adapter<MyPersonalAdapter.MyPersonalViewHolder>
I'm getting a reference to the EditText in that inner class:
class MyPersonalViewHolder extends RecyclerView.ViewHolder {
TextView numberTextView;
EditText nameEditText;
public MyPersonalViewHolder(View itemView) {
super(itemView);
numberTextView = (TextView) itemView.findViewById(R.id.tv_number);
nameEditText = (EditText) itemView.findViewById(R.id.et_name);
}
}
and in my MainActivity I want to use:
for (int i = 0; i < count; i++) {
String name = "Somehow get that name";
cv.put(MyContract.MyEntry.COLUMN_NAME, "name");
}
I created a getData function inside my Adapter class.
Then in my MainActivity
By this, you can save edit text entries in the array.
Try this way,
class MyPersonalViewHolder extends RecyclerView.ViewHolder {
Also, define a function
Now getValue can call from MainActivity.
Here is the code in adapter,Did't work with textchange listener..So i had to used textchange listener and setOnfoucusChange(100% working)
And in activity write the following code
try this:
Got it working, here is the edited code:
This worked for me:
mySetEnabled
is a method I implemented within my viewHolder.