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 recommend you to utilize startActivityForResult instead of startActivity, then in order to retrieve the origin/source activity- call getCallingActivity().getClassName().
How will A know it came from home?
Use getIntent() its
getAction() -> android.intent.action.MAIN
and
getCategories() -> android.intent.category.LAUNCHER