Ok so imagine two fragments, one BrowserFragment with a WebView and one BookmarksFragment which contains a list of bookmarks and a button to add new ones.
If I click on the AddBookmarkButton, I have to call getUrl on the WebView in the BrowserFragment and pass it back to the BookmarksFragment.
If I click on a bookmark in the list, I have to call loadUrl on the WebView.
What would be the best practice to achieve this in AndroidX? I read the Fragments Communication Guide but I don't think this is achievable using a ViewModel.
I think it's possible using fragmentManager.setFragmentResult and setFragmentResultListener but I don't know if that's the best way to do it..
Or I could just get the BrowserFragment using findFragmentByTag but afaik that is bad practice no?