You can use several methods, from a text file, database or SharedPreferences, I think the simplest thing would be to use the latter.
You define a method to save the desired value:
public void saveValuePreference(Context context, String identificador, String text) {
SharedPreferences settings = context.getSharedPreferences("mispreferencias", MODE_PRIVATE);
SharedPreferences.Editor editor;
editor = settings.edit();
editor.putString(identificador, text);
editor.commit();
}
and a method to obtain the values when you re-enter your application:
public String getValuePreference(Context context, String identificador) {
SharedPreferences preferences = context.getSharedPreferences("mispreferencias", MODE_PRIVATE);
return preferences.getString(identificador, "");
}
Assuming you want to save the value of your EditText, we define an identifier called "miprimerdato", and as a last parameter you define the value of the EditText:
saveValuePreference(getApplicationContext, "miprimerdato", EditText .getText().toString());
to get the value again you define the identifier to get the preference data:
String valorEditText = getValuePreference(getApplicationContext(), "miprimerdato");