fragment stuck cannot move to another fragment in Android Navigation
Hello folks, first time meeting with me. The biggest challenge in android development when some components are having problems after deprecated or updating to latest version. Sometimes what makes some novice android developers confused about this problem, what should I do. Do you have to replace it with another component, or do you have to manually create your own function to replace the component itself.
In here I want to explain how to fix fragment stuck cannot move to another fragment in Android Navigation. One of the things that inspired me to write this article, after a few months of confusion about creating a personal project. Why can’t this section move from frame to frame, or did I mess up the code I wrote in that section(one of the most important components in building a more complex application). So, don’t let me be nicknamed TMT or Talk a lot. Let’s have a look at the sample code I’m about to explain.
then I tried to find a solution, then like this
But, look the crossed out and highlighted writing there, it feels a bit sensitive if you find it. Posts describing deprecated component library functions. Therefore, I will try to explain briefly how to solve it, by creating a simple utils function to make the function disappear underlined scribbles and the code is simpler than that function.
Then to call it in MainActivity class like this
That’s all I want to say. Finally, if you have any comments or suggestions, please comment below. Happy if you provide suggestions and additions in this article, hope it helps. Thanks