Assigned
Status Update
Comments
ha...@google.com <ha...@google.com>
se...@google.com <se...@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
Component used:
androidx.emoji2:emoji2
Version used:
1.4.0-beta05
Devices/Android versions reproduced on: -
In earlier versions of Emoji2,
EmojiCompat.reset()
was not limited to be used inside the library or for testing purposes, which at least I use in my emoji font picker library to update the selected emoji font. In the original EmojiCompat library I had to do an app restart - withreset()
, only the Activity needs to be restarted/switched.While I understand that this is not a feature that is intended for public use, it can be pretty useful. Would it therefore be possible to make it an opt-in feature (if that exists for Java) or similar?