Reputation: 11765
I want to find out which activity started my activity in android. I can get the intent that started the activity using getIntent()
but I am not able to find out which activity started the intent in the first place.
Upvotes: 33
Views: 14321
Reputation: 33782
Use getCallingActivity()
Note: if the calling activity is not expecting a result (that is it did not use the startActivityForResult(Intent, int)
form that includes a request code), then the calling package will be null
Upvotes: 30