Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
The documentation speak about conditional navigation here:
for cases where you need to be logged in on a screen.
I think cases like that would benefit a lot if they could handle a result callback.
Something similar to what we already have with the Activities:
startActivityForResult(intent, REQUEST_ID)
...
onActivityResult(...)
instead would be something like:
navController.navigateForResult(direction)
navController.setResultHandler{ result ->
}
and being able to define result in the navigation xml
<fragment
android:id="@+id/some_destination"
android:name="com.example.SomeResultFragment"
android:label="Fragment Providing a result">
<result app:code="@+id/success">
<argument
android:name="someValue"
app:argType="string"/>
</result>
</fragment>
each result could have a code and a list of argument similar to the arguments to launch and code could be generated accordingly by safeargs plugin.