I am developing an Android app in java using MVVM architectural pattern and Data Binding. The app has an activity which hosts two fragments (one at a time) using NavHostFragment (planning to add more different fragments in the future) each with one EditText component. The host activity has a button which is intended to confirm the user’s input from the fragment and process it.
I have read Communicate with fragments but wasn’t able to implement the desired functionality. Any guidance would be greatly appreciated.