Reputation: 41685
Both onActivityResult
and getIntent
receives intent from other activities.
when one is used over another?
I think onActivityResult is called after I call startActivityForResult to receive a result.
I guess then getIntent
is used to receive intent which was sent by someone other than me. Is it correct?
Below is my understanding how it's used, wonder if the understanding is correct.
onResume
to check the intent Upvotes: 0
Views: 352
Reputation: 157457
I think onActivityResult is called after I call startActivityForResult to receive a result.
on onActivityResult
is called when you finish()
the Activity that you started with startActivityForResult
. You can provide an Intent
to setResult
, which you will get back as part of onActivityResult
I guess then getIntent is used to receive intent which was sent by someone other than me. Is it correct?
getIntent()
returns the intent that started the current Activity
Upvotes: 3