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?

Was it helpful?

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();

OTHER TIPS

Save your stuff in onPause() or onSaveInstance()

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top