Question

I have got some trouble with reading a file. I read the file from onCreate, but if I change the text on the next page it saves but I don't see the new data.

I save in file in onPause, onSaveInstance, but if I restart the application it's ok. But I don't know why only that. When I must read file?

Était-ce utile?

La solution

follow below steps:

  1. use startActivityForResult(intent, requestCode);
  2. goto next page(activity) change file and save file also
  3. then use Intent returnIntent = new Intent(); //intent.putExtra("SOMETHING", "EXTRAS"); (if file changes) setResult(RESULT_OK, intent); else setResult(RESULT_CANCELED, intent);(if file did not change)
    finish();

Autres conseils

Save your stuff in onPause() or onSaveInstance()

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top