I have a reservation wizard in android, when i say wizard i mean i have multiple activities (meaning screens) that are passed from one to another until booking is complete. in each step of the way my info may be invalid and so ill have to back track 2-3 activities and start all over, all the activities i back tracked should be destroyed, they may need to invalidate a singletone data container that they filled with their data. I thought of 2 ways to do this:
- start all activities related to the wizard with startActivityForResult() so i get notification when an activity is finished and with which error code (finished ok or error occurred) and act accordingly (for instance: if in the middle an activity fails it will return failed and the previous one will return failed as well until i get to the wizard's first activity where i either declare the error with a dialog or show the 'thank you' screen.)
- I can send an react on intents with certain parameters so i have a 'close and clean' intent message that close down the previous activity etc...
which way is better, any other interesting\efficient way to do this ?