F
F
foonfyrick2020-11-25 13:14:27
Android
foonfyrick, 2020-11-25 13:14:27

DefaultNavHost prevents all fragments from moving back, how to disable the back button for one fragment?

I have 2 fragments, in the first one I select a list, in the second one I edit the selected list, how can I make it so that after exiting the second fragment into the first one, I could not press the back button, or I could but it would not return me to the previous fragment, did you just close the app? If I set defaultNavHost to false, then the back button is blocked in all fragments, and I need only in the very first, starting one.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question