How to pass data between fragments when using bottomNavView
问题 I have an app with one activity and two fragments, And I navigate using jetpack navigation. In my "Main" fragment, I've a button that trigger function inside the viewModel: edit_text_button.setOnClickListener { homeViewModel.onButtonClicked() } onButtonClicked inside viewModel , basically shuffle the list and trigger observer in main fragment. fun onButtonClicked() { initList = (1..9).shuffled() _list.value = initList } My question is: How can I pass every time the updated list to the second