Let's say I have four activities: StartActivity, ConfigureActivity, GameActivity, and ResultActivity. The flow of activities is as such:
- StartActivity starts ConfigureActivity with intent
- ConfigureActivity starts GameActivity with intent
- GameActivity can go back directly to StartActivity by starting it with intent
- GameActivity can start ResultActivity with intent
- ResultActivity starts StartActivity with intent
While in GameActivity, the user has the opportunity to gather Strings that he or she want to save for later use. These are added to a simple ArrayList of Strings which I will later need in StartActivity.
From GameActivity, the user might either start the ResultActivity, or exit the current activity to go back to StartActivity.
When going from GameActivity to ResultActivity, and then from there back to StartActivity, the ArrayList is passed along the way through intents. On regular exit, which is done by listening to onKeyDown, an intent is in the same way (data is passed back to StartActivity).
Now, I know you can use startActivityForResult to start an activity with excpectation to get something back. But I since my StartActivity actually launches ConfigureActivity, and that ConfigureActivity will not at all be involved with this data, how can I do this? I use SharedPreferences for application settings, but there I have xml-files with items that will never change. In this case, the list might vary from 0 to maybe 100 strings. Should I use sqllite?
Also, I am not providing any code because I am only looking for some conceptual guidance and I do not specifially need code example as response to this question.