Answer the question
In order to leave comments, you need to log in
How to save EditText -> RecyclerView value to file?
The bottom line is that there is an activity Structure in it RecyclerView; RV contains a CardView "tier"
tier also contains a RecyclerView and it contains a set number of other CardViews with EditText cells.
And after calling the onPause() method in the activity, they should be saved to a binary file.
It is necessary somehow to inform each object where to take the data. Taking into account that there will be many such tiers and elements with cells are also changeable
Something like this
object1.setCoef(coef.getText().toString());
Answer the question
In order to leave comments, you need to log in
So far implemented through TextWatcher
onBindViewHolder(ProductViewHolder holder, int position) {
...
holder.textCoef.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
//Действия при изменении поля EditText
}
});
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question