Android Bottom navigation icon is not highlighted correctly

19 Views Asked by At

so i am using android's Navigation Component version 2.7.7 for this

right now i have 3 main tabs, let's call them Tab A, B, C

whenever i go in a child fragment within Tab B for example, and click on Tab C while B was on the child fragment, and click back to Tab B, the highlighted icon stays on Tab C instead of B

from what i can tell, this issue is due to the child fragment within B being loaded again, instead of the main B fragment, which for the bottom_nav_menu.xml file is not the correct fragment ID for both the menu position & loaded fragment in nav_graph.xml and that's what causes the issue

is there a workaround for this?

0

There are 0 best solutions below