Let us say we have two fragments A and B, We send an object O1 from fragment A to B using Bundle and bring fragment B into the current activity.Do some changes with O1 i.e store data in payload object O1 and now we come back to fragment A where the save button is placed. Now if we save the data which O1 has i.e O1.savetoDatabase() We don't get the data changes we made in fragment B. Is there a possible way to get the changes in the fragment A for the object passed to fragment B? (something like the references which inflicts the changes)
EDIT: The answer two which uses setTargetFragment seems to work but the only problem is when I am on fragment B and then send data to fragment A, I am receiving the data in the object O1(this works fine) of fragment A but when I press the back button from fragment B to fragment A, Data in O1 is lost due to fragment recreation. What should be done to persist the data sent?