Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
This has been fixed internally by https://android-review.googlesource.com/864732 and developers can now use by navArgs() in both activities and Fragments to retrieve an instance of their generated Args class.
As a side effect of this change, the Args.fromBundle(Bundle) methods have been replaced with constructors that take a Bundle.
As a side effect of this change, the Args.fromBundle(Bundle) methods have been replaced with constructors that take a Bundle.
Description
Version used: 1.0.0-alpha06
Navigation has the ability to set a default graph from your manifest via NavController.setMetadataGraph() and NavInflater.inflateMetadataGraph().
The existence of this API promotes bad patterns (automatic defaults that reside far from the code invoking it) and can outright break other functionality such as setting a programmatically inflated NavGraph onto a NavHostFragment (as NavHostFragment will use the metadata graph by default, calling setGraph with the wrong graph).
These API should be removed entirely to prevent issues - developers should call NavHostFragment.create() or call setGraph() with exactly the graph they want.