To pass a data from one activity to another you need to put that data in a bundle and pass it in the intent:
Bundle bundle = new Bundle();
bundle.putString(“key”, “MyDataString”);
Intent a = new Intent(Sender.this, Receiver.class);
a.putExtra(bundle);
startActivity(a);
However, say I have 3 activities. Each of these activities needs access to the same collection object: an array of photos.
Activity 1 needs to display the photos in list view
Activity 2 needs to display those photos in a completely different layout
Activity 3 needs to display some of the photos but can also dynamically replace which ones are being shown
As a result: all 3 activities need to share the same data object.
Do I need to keep passing the object as a bundle between each activity or is there a way to have only 1 instance of it and all 3 classes share it?