I would like to know if it is possible to store the information of an EditText without having to click on any type of button, that is, at the same time that the user writes can be saved, and be accessible when the application starts again . The idea would be that the first time the user starts the application, they could enter their data manually, and at that moment they will be saved, so that when they reload the application they would be available and visible to the user.
My application starts with this view, and what I want to do is save the data at the same time they are written.
The thing is that if I had a button it would be easy enough to save it, but I would like to do it without a button. My idea is to save it with sharedPreferences, although the DNI will also save it with sqLite. I know that EditText has these events:
editText.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
// Fires right as the text is being changed (even supplies the range of text)
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// Fires right before text is changing
}
@Override
public void afterTextChanged(Editable s) {
// Fires right after the text has changed
}
});
but, how do I make it so that once I write the value I can save it? Thank you very much, best regards.