Here is what I think :
Create a public static ArrayList<String>
object in any one of the class so that you can use it in all other activities.
Now In onResume()
method, check whether the className exists, if yes then dont add className in arrayListObject. Otherwise add the className of current activity in arrayListObject using add method of arrayList ie arrayListObject.add(activityName);
.
You can get Class Name using :
#1 this.getClass().getName();
#2 Directly use "ABCActivity"
#3 context.getClassName();
Now you can use this arrayListObject to display all this values in TextView
.
Note :
You will also have to take care of when the Activity1 is launching for the first time. At that time you will have to clear the arrayListObject and then have a fresh start.
For this I recommend you to go through the post : Application Launch Count