title: Communicate between views from different fragments in Android
body: <p>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.</p>
  <p>If I click on the AddBookmarkButton, I have to call getUrl on the WebView in the BrowserFragment and pass it back to the BookmarksFragment.</p>
  <p>If I click on a bookmark in the list, I have to call loadUrl on the WebView.</p>
  <p>What would be the best practice to achieve this in AndroidX? I read the <a href="https://developer.android.com/guide/fragments/communicate" rel="nofollow noreferrer">Fragments Communication Guide</a> but I don't think this is achievable using a ViewModel.</p>
  <p>I think it's possible using fragmentManager.setFragmentResult and setFragmentResultListener but I don't know if that's the best way to do it..</p>
  <p>Or I could just get the BrowserFragment using findFragmentByTag but afaik that is bad practice no?</p>