Hello, I'm using androidx.navigation:navigation-*:...
# navigation-architecture-component
y
Hello, I'm using androidx.navigation:navigation-*:2.7.5 and noticed a potential issue with NavController#onGraphCreated not being called when calling setGraph twice. This seems to be related to the commit found here: https://android.googlesource.com/platform/frameworks/support/+/d22366d59a46aa16aa79d1d691cd5cb55f56c378 I'm trying to find a way to force NavController#onGraphCreated to be called in this scenario. Here's why I need this: I have an Activity with launchMode set to singleTop. • When the Activity is started for the first time, onCreate is called and NavController#setGraph is used to set the initial graph. • When the Activity is started again (via startActivity), onNewIntent is called. Inside onNewIntent, I call NavController#setGraph again to update the UI. This worked fine in 2.7.4, but in 2.7.5, the UI no longer updates when calling setGraph in onNewIntent. Is there any way to force NavController#onGraphCreated to be called in this situation? Any help would be greatly appreciated.
d
Did you ever solve this problem? I think I'm maybe having a similar problem...
y
We haven't resolved this issue yet, and we're considering the following. Is the launchMode of the Activity you're having an issue with set to singleTop? If so, I'm considering removing the singleTop mode. If we do that, this article might be helpful: https://medium.com/@douglas.iacovelli/android-send-result-back-through-multiple-activities-finished-or-not-4c2ba9e95112 However, in our project, it's problematic if Activities stack up, so I'm currently considering how to handle that.