Enol Simón
06/19/2024, 7:22 PMNavHost 1
-> This NavHost shows the main screen or the detail screen.
• MainScreen
(With navigation drawer)
◦ NavHost 2
-> This NavHost changes screens inside the Navigation Drawer
▪︎ DashboardScreen
.
▪︎ ListScreen
.
• DetailScreen
When I change between screens from the NavHost 2
, all the screens are rendered only once (I have logs in each of the screens so I can see how many times they are rendered).
I pass as parameter NavHost1
to the different screens, so when for example I click on an element of the ListScreen
, I use the NavHost1
to navigate to the DetailScreen
. Then I pass the NavHost1
to the DetailScreen
too, so I can navigate back.
The main problem is that when I open the DetailScreen
, I see that it Is re-rendered ListScreen
and then DetailScreen
few times.
The same happens when I navigate back, it renders again DetailScreen
and then ListScreen
few times.
Anybody else is having or is aware of having the same problem? Why the screen that I am leaving is rendered again when I navigate or I navigate back to it?
Thank you in advanceeygraber
06/19/2024, 7:42 PMIvan Matkov
06/19/2024, 7:52 PMPablichjenkov
06/19/2024, 7:52 PMeygraber
06/19/2024, 7:59 PMEnol Simón
06/19/2024, 8:02 PMEnol Simón
06/19/2024, 8:20 PMeygraber
06/19/2024, 8:23 PMIvan Matkov
06/19/2024, 9:20 PMAndroidOn android it's original Google's binary, so it's better to file issue not to multiplatform - it's not the change in JB fork
Enol Simón
06/20/2024, 7:55 AMIvan Matkov
06/20/2024, 8:03 AMBut it happens in both platformsIt means that it's not the change during multiplatform adoption
I could prepare a minimum example on github if it is useful for you guys.Yep, thanks. If the issue is about difference between Multiplatform and original Android - CMP GitHub is the right place. If the problem happens on Android - it's better to open an issue to Google's issue tracker (should be reproducible without multiplatform setup) I know it's sounds not supper clear, but initial implementation owned by Google and our fork is handling only multiplatform adaptation. Changes in the fork will NOT affect Android anyhow