Access all instances of NavController?

As I understand it, in a tab-based application, there is a separate NavController instance for every tab. Since every tab has it’s own view stack, I guess that must be the case, right?

So how would I be able to access the NavController for a tab that I’m not currently on?

Let’s say that I have two tabs, Tab1 and Tab2. I have opened (navController.Push()) a few views in Tab1 and then navigated to Tab2. How would I go about closing (“popping”) the last view on Tab1 from Tab2, WITHOUT navigating to Tab1? So that when I later navigate to Tab1, the last view is already closed?

Hope that makes sense, I’ll try to clarify otherwise.

you must inject Tabs in your page’s constructor, and then use its “getByIndex()” method that will return a Tab, which is simply a NavController instance