Is it possible to know if some activity has been called for result, using startActivityForResult()
or if was only started using startActivity()
?
I need to control this, if its called for result the behaviour will be different.
Is it possible to know if some activity has been called for result, using startActivityForResult()
or if was only started using startActivity()
?
I need to control this, if its called for result the behaviour will be different.
When your activity was started just by
startActivity()
agetCallingActivity()
method in target activity will returnnull
.When it was called by
startActivityForResult()
it will return name of calling activity.See Docs for
getCallingActivity()
: