Jetpack offers a new solution, which is Activity Result API, to deprecate startActivityForResult
and onActivityResult
for Activity
/Fragment
passing data respectively.
One of the reasons is that Activity Result API makes calling an activity for result type-safe.
I am confused. startActivityForResult()
and onActivityResult()
of Activity
/Fragment
has been used for a long time. About disadvantage like code coupling, separation of request and response, I knew.
But, how is data passed by onActivityResult()
not type-safe?