title: Can't update CollapsingToolbar title after calling setHasOptionsMenu()
body: <p>I'm trying to update the title in a <code>CollapsingToolbarLayout</code> from a Fragment (the toolbar itself is in the Activity XML). This works fine most of the time, but when I have to add menu items from the <code>Fragment</code> as well, then it stops working and the previous title remains visible.</p>
  
  <p>This is the code in my Fragment:</p>
  
  <pre><code>override fun onActivityCreated(savedInstanceState: Bundle?) {
      super.onActivityCreated(savedInstanceState)
  
      // If I remove the line below then the title is updated just fine
      setHasOptionsMenu(true)
  
      activity?.collapsingToolbar?.title = ""
  }
  </code></pre>
  
  <p>I found a workaround for this issue (seems like the problem is a race condition during the views drawing) by using </p>
  
  <p><code>Handler().post { activity?.collapsingToolbar?.title = "" }</code> </p>
  
  <p>instead of </p>
  
  <p><code>activity?.collapsingToolbar?.title = ""</code>.</p>
  
  <p>However, I don't like the fact that I have to create a <code>Handler</code> for this specific purpose, it seems like the support library should take care of the serialization of these things.</p>
  
  <p>Does anyone have a better solution?</p>