Assigned
Status Update
Comments
lb...@gmail.com <lb...@gmail.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.
vi...@google.com <vi...@google.com> #3
Turns out, we already had a tracking bug for this issue, will follow up on that other one.
lb...@gmail.com <lb...@gmail.com> #4
Thank you for promptly replying to my report. You are right that the issue you've just mentioned is similar to mine. I shall continue observing the progress over there.
si...@google.com <si...@google.com> #5
lblb636@ is the preference you mentioned a platform API or androidx API?
lb...@gmail.com <lb...@gmail.com> #6
@5 I wrote that I use android-x on #2 and #4 ...
Description
I used :
EmojiCompat.init(BundledEmojiCompatConfig(this))
and in gradle (BTW docs are outdated, should be of android-x) :
implementation 'androidx.emoji:emoji-bundled:1.0.0'
But I don't see it working on preferences .
It shows the icon of "X" with square instead of emojis.
Tested on this emoji as title of some switchPreference:
🧪
Maybe I'm missing something?
Tested on emulator with Android API 27.