We have a graph A with activity A1 and we want to open graph B with activity B1 using startActivityForResult()
to get a result back from B1 to A1.
The problem is that A and B graphs live in separate dynamic feature modules so in A1 we don't have access to the class of activity B1 to call startActivityForResult()
.
We do have the navigation graphs of both modules connected so that we can navigate between modules but Android Architecture Navigation does not support startActivityForResult()
How can we call startActivityForResult()
using the navigation direction defined in the Android Architecture Navigation?
It is possible to get the launch intent of an action defined in the navigation graph. To achieve it you need to:
See https://developer.android.com/reference/androidx/navigation/ActivityNavigator.Destination#getIntent()