I have an application with activities back stack A -> B -> C -> D -> E. Now at activity E, I want to know the back stack activities that I navigated from. How do I find this
I think you can do it by listening to the changes of the activities, via this API of registerActivityLifecycleCallbacks :
https://developer.android.com/reference/android/app/Application.html#registerActivityLifecycleCallbacks(android.app.Application.ActivityLifecycleCallbacks)
https://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html
This will help you to add to a stack of your own classes, and see the full state as you wish.