I’m new to kotlin and I am having a hard time trying to create a form in my app. The form uses a main fragment where you can click on different attributes where it opens a new fragment, where you can insert data. When you are done filling in the data in the child fragment, I want to go back to the main fragment. I have managed to pass data between them using an interface and navigational component/safe args, and I am using a model view in the activity which holds the different fragments to manage the data. As far I’m concerned my code has turned into spaghetti code, and something tells me I’m not doing it right. What is the best way to create a form where you can have several child fragments that send data back to the main fragment, and the main fragment retains the data?
I would appreciate it if someone could point me in the right direction.