Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
This is affecting CameraView as well.
ch...@gmail.com <ch...@gmail.com> #3
Bugjuggler: wait until next quarter
il...@google.com <il...@google.com> #4
Hi. I've received your bug and will wait until 2020-01-01 00:00 -0800 PST and then assign the bug to ericng@google.com.
ch...@gmail.com <ch...@gmail.com> #5
Hello,
A fix has been applied for most cases in Alpha08 (Dec 18th release), however we are keeping this open for a more robust fix to come. Thanks.
A fix has been applied for most cases in Alpha08 (Dec 18th release), however we are keeping this open for a more robust fix to come. Thanks.
Description
I have two Activities, MainActivity and SecondActivity. Using Navigation architecture in MainActivity, which has two fragments, such as HomeFragment and DetailFragment, the Navigation diagram is declared as follows:
Generate ViewModels in the DetailFragment onCreate with "by navGraphViewModels".
There is a button in DetailFragment, clicking it will jump to SecondActivity, when "Do not keep background Activity" is enabled, pressing the back button in SecondActivity will trigger the program crash:
If I put the vm creation declaration in the onViewCreated lifecycle or later, there will be no crashes.
Does "by navGraphViewModels" necessarily require the user to use it this way?
In my opinion, as long as the NavBackStackEntry viewModelStore corresponding to "R.id.navigation_home_flow" is in the CREATED state, it's OK, not the DetailFragment.
The Navigation version I use is 2.4.0-alpha06.
Thanks in advance if you can address my issue.