follow below steps:
- use startActivityForResult(intent, requestCode);
- goto next page(activity) change file and save file also
- 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();