title: Kotlin Toolbar Menu Icon issue
body: <p>I converted the following Java Code to Kotlin Code. Android Studio does not show any error message.<br>
  But the result is different. I added two pictures of the emulator result.<br>
  As you can see the Java one works fine and shows the 3-dot menu icon in the toolbar. But the Kotlin code does not work.<br>
  Do someone know what the mistake is? Hope for some help. Thanks.</p>
  
  <p><strong>Java:</strong></p>
  
  <pre><code>        @Override
          public View onCreateView(LayoutInflater inflater, ViewGroup container, 
          Bundle savedInstanceState) {
                  View view = inflater.inflate(R.layout.fragment_home, container, false);
  
                  //...
                  setHasOptionsMenu(true);
  
                  return view;
              }
  
  
  
          @Override
          public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
                  menuInflater.inflate(R.menu.menu_main, menu);
          }
  
          @Override
          public void onPrepareOptionsMenu(Menu menu) {
                  MenuItem settings = menu.findItem(R.id.settings);
                  MenuItem singOut = menu.findItem(R.id.sign_out);
                  settings.setVisible(true);
                  singOut.setVisible(false);
          }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/1pJq1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1pJq1.png" alt="enter image description here"></a></p>
  
  <p><strong>Kotlin:</strong></p>
  
  <pre><code> override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
          val view = inflater!!.inflate(R.layout.fragment_home, container, false)
  
          //...
          setHasOptionsMenu(true)
  
          return view
      }
  
  
  
        override fun onCreateOptionsMenu(menu: Menu?, menuInflater: MenuInflater?) {
              menuInflater!!.inflate(R.menu.menu_main, menu)
          }
  
          override fun onPrepareOptionsMenu(menu: Menu?) {
              val settings = menu!!.findItem(R.id.settings)
              val singOut = menu.findItem(R.id.sign_out)
              settings.isVisible = true
              singOut.isVisible = false
          }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/1I6fw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1I6fw.png" alt="enter image description here"></a></p>