I have three fragments (A,B,C) in an activity. Fragment A leads to B and Fragment B leads to C. In Fragment C, the user has two options. He could either go back to Fragment A or he could destroy the entire activity. If he chooses to go back to Fragment A, I want the current set of data to be saved in a list in fragment C, then same cycle is repeated. However when he reaches fragment C the next time I want the current data to the added to that list.
How can I implement this using onPause() and onResume()? If there is a better way of doing this, kindly let me know. I cannot store in shared preferences since the data will be an ArrayList of an object.
I would appreciate if anyone can show me a basic structure of how we could implement this in a code.