# navigation-architecture-component

Yasutaka Kawamoto

03/13/2024, 12:52 AM
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: 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.


04/09/2024, 10:55 AM
Did you ever solve this problem? I think I'm maybe having a similar problem...

Yasutaka Kawamoto

04/13/2024, 1:42 PM
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: However, in our project, it's problematic if Activities stack up, so I'm currently considering how to handle that.