Gabriel Llamas
Gabriel Llamas

Reputation: 18447

How to know what Activity has started the current Activity

How can I know what Activity has started the current Activity? Is there any specific method like, i.e. getIntent().getCallerActivity() or the only way is saving some information within the Intent using putExtra()?

Thanks.

Upvotes: 2

Views: 1271

Answers (1)

Firas Assaad
Firas Assaad

Reputation: 25780

There's getCallingActivity which you can use to get the name of the calling activity if you started the sub-activity with startActivityForResult.

Upvotes: 6

Related Questions