I use Kotlin so the example code will be in Kotlin only, but I will try to comment out each line of code.
Solution 1: Create a SingleTon
class to hold data and use its data on at ending activity.
class DataHolder { //public class
companion object { //Equavilent to Java static.
var variable1 = 0
var variable2 = "Some string" //Define your static variables.
....
}
}
Access this Singleton class in your Activity1 -> Activity2 and so on. When you reach your ending activity, simple reaccess this class and retrieve the respective data stored.
Pro: Less repeated Intent code in your activities.
Cons: Obviously static variables are permanent unless it's class loader goes out of scope. Since the data is very little, nothing too much to worry about.
Solution 2: Create intents, load data and gradually pass it on to your activities and retrieve the data at the ending activity. The only downside is that you would have to take extra care to repeatedly insert data, grab the data with the respective key. Maybe 'error' prone unless you stay extra cautious.