Assigned
Status Update
Comments
em...@google.com <em...@google.com> #2
This actually has nothing to do with NavHostFragment, but is the behavior of NavController's setGraph().
When you call navController.setGraph(R.navigation.navigation_graph), it stores that ID and will restore that ID automatically.
If you were to instead use:
NavInflater navInflater = new NavInflater(this, navController.getNavigatorProvider());
navController.setGraph(navInflater.inflate(R.navigation.navigation_graph));
Then NavController would not restore the graph itself and the call to restoreState() you point out would only restore the back stack state, etc. but would wait for you to call setGraph again.
You're right that the inconsistency between the two setGraph methods is concerning. We'll take a look.
When you call navController.setGraph(R.navigation.navigation_graph), it stores that ID and will restore that ID automatically.
If you were to instead use:
NavInflater navInflater = new NavInflater(this, navController.getNavigatorProvider());
navController.setGraph(navInflater.inflate(R.navigation.navigation_graph));
Then NavController would not restore the graph itself and the call to restoreState() you point out would only restore the back stack state, etc. but would wait for you to call setGraph again.
You're right that the inconsistency between the two setGraph methods is concerning. We'll take a look.
Description
Version used: 1.0.0 (also affects 1.1.0-alpha01)
Steps to Reproduce the Problem:
Step #1: Search the documentation for SliceAction, to determine how we are supposed to create instances of this class
Step #2: Land on
Step #3: Notice that this is an interface, with no details in the JavaDocs about where and how you are supposed to get instances of this interface
Step #4: Notice that the JavaDocs do point out an implementation of SliceAction... which is also named SliceAction
Step #5: Visit that class documentation at
At minimum, please consider putting documentation on the interface SliceAction to explain that the concrete implementation is the other SliceAction. Even better, rename one of these to be something other than SliceAction, so developers do not get mystified (e.g., code completion).
This was originally filed against the 1.0.0 beta as