Obsolete
Status Update
Comments
sb...@google.com <sb...@google.com> #2
Oh and one more thing I forgot. Fragment A's child fragment is also part of the nested navigation controller, for which the Fragment A contains the root NavHostFragment, and not the root nav controller Fragment A is part of. So maybe it's not due to FragmentManager, maybe it's the nested navigation controller prematurely removing it's own fragment, when exitAnimation starts for it's root/parent fragment A.
Other than that, instanceState of the child fragment is preserved properly when navigating back and forth.. It's just that it's view is removed prematurely for some reason.
Other than that, instanceState of the child fragment is preserved properly when navigating back and forth.. It's just that it's view is removed prematurely for some reason.
ha...@gmail.com <ha...@gmail.com> #3
Ok I just tested it, and it is due to nested navigation graph. When I include a child fragment directly into Fragment A, without navigation, it's not removed prematurely and it's working as intended.
So where do we go from here, is this a bug for you to fix, or there's something wrong with my nested navigation graph implementation, in which case I'd like you to point me in the right direction how to fix it?
So where do we go from here, is this a bug for you to fix, or there's something wrong with my nested navigation graph implementation, in which case I'd like you to point me in the right direction how to fix it?
sb...@google.com <sb...@google.com> #4
Can you attach a sample project that reproduces your issue?
ju...@gmail.com <ju...@gmail.com> #5
Here you go: https://drive.google.com/file/d/12Tz8YjCEbcs4LzxqL4352zUJyPvJ_GLt/view?usp=sharing
I slowed down the animations so you can see what's happening.
Root Fragment A is the one with BottomNavigationBar on the bottom.
GREEN - Fragment A's CHILD fragment (the one that's disappearing)
RED - Destination Fragment
Press "Settings" in the action menu on the upper right to start navigation. Observe how Root Fragment A is visible during the whole animation with it's BottomNavigationBar, but it's CHILD GREEN fragment disappears immediately, as it is part of the nested navigation graph hosted in the Fragment A itself.
On the way back, Fragment A is properly recreated with it's green child fragment, and both are visible properly (when going back in the direction A <- B).
I slowed down the animations so you can see what's happening.
Root Fragment A is the one with BottomNavigationBar on the bottom.
GREEN - Fragment A's CHILD fragment (the one that's disappearing)
RED - Destination Fragment
Press "Settings" in the action menu on the upper right to start navigation. Observe how Root Fragment A is visible during the whole animation with it's BottomNavigationBar, but it's CHILD GREEN fragment disappears immediately, as it is part of the nested navigation graph hosted in the Fragment A itself.
On the way back, Fragment A is properly recreated with it's green child fragment, and both are visible properly (when going back in the direction A <- B).
ju...@gmail.com <ju...@gmail.com> #6
I'm having trouble downloading your project from Google Drive for some reason. Would you mind attaching it here directly?
I suspect this is a Fragment issue and not something Navigation can control. I'd be interested to know if you run into the same issue if you have *any* Fragment, rather than a NavHostFragment, between your child of A and A itself.
I suspect this is a Fragment issue and not something Navigation can control. I'd be interested to know if you run into the same issue if you have *any* Fragment, rather than a NavHostFragment, between your child of A and A itself.
sb...@google.com <sb...@google.com>
[Deleted User] <[Deleted User]> #7
I'll test that too when I have some time, though it might not be soon.
I'll attach the project directly so you can test it yourself, and if it is the problem with Fragments, then let's open the issue for Fragments..
I'll attach the project directly so you can test it yourself, and if it is the problem with Fragments, then let's open the issue for Fragments..
Description
Internal error. Please report to
com.intellij.ide.plugins.PluginManager$StartupAbortedException: java.lang.reflect.InvocationTargetException
at com.intellij.ide.plugins.PluginManager$2.run(PluginManager.java:88)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.ide.plugins.PluginManager$2.run(PluginManager.java:85)
... 1 more
Caused by: java.lang.ClassFormatError: Incompatible magic value 1147368545 in class file com/intellij/openapi/util/UserDataHolder
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.lang.ClassLoader.defineClass(ClassLoader.java:635)
at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:189)
at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:185)
at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:146)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.lang.ClassLoader.defineClass(ClassLoader.java:635)
at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:189)
at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:185)
at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:146)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.lang.ClassLoader.defineClass(ClassLoader.java:635)
at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:189)
at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:185)
at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:146)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.lang.ClassLoader.defineClass(ClassLoader.java:635)
at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:189)
at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:185)
at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:146)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.lang.ClassLoader.defineClass(ClassLoader.java:635)
at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:189)
at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:185)
at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:146)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.intellij.openapi.application.ex.ApplicationManagerEx.createApplication(ApplicationManagerEx.java:39)
at com.intellij.idea.IdeaApplication.<init>(IdeaApplication.java:109)
at com.intellij.idea.MainImpl$1.start(MainImpl.java:37)
at com.intellij.idea.StartupUtil.prepareAndStart(StartupUtil.java:113)
at com.intellij.idea.MainImpl.start(MainImpl.java:34)
... 6 more