I have recyclerview with edit text. Each row has a edit text. I am entering values in the edit text manually and after i enter values, I want to get those values in each and eve
To do this there are two ways:-
1) Add save Button in each row of RecyclerView on this Button click (onClick)
@Override
public void onClick(View v) {
String ans = holher.numPicker.getText().toString();
// save ans to sharedpreferences or Database
}
2) Add onTextChangedListener to EditText
holher.mumPicker.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {}
public void beforeTextChanged(CharSequence s, int start,
int count, int after) {
}
public void onTextChanged(CharSequence s, int start,
int before, int count) {
String ans = holher.numPicker.getText().toString();
// save ans to sharedpreferences or Database
}
});
Then in your MainActivity.java retrive data from sharedpreferences or database