title: KotlinNullPointerException: inside onCreateOptionsMenu can't find searchView; android
body: <p>I need MainActivity with SearchView, it throws KotlinNullPointerException: inside onCreateOptionsMenu; here is my code: </p>
  
  <p>options_menu.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
  
  &lt;item
      android:id="@+id/search"
      android:actionViewClass="android.widget.SearchView"
      android:icon="@android:drawable/ic_menu_search"
      app:showAsAction="collapseActionView|ifRoom"
      android:title="@string/search" /&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p>MainActivity.java </p>
  
  <pre><code>import android.text.TextUtils
  import android.view.Menu
  import android.widget.AdapterView
  import android.widget.SearchView
  import android.widget.Toast
  ...
  import kotlinx.android.synthetic.main.activity_main.*
  import android.app.SearchManager
  import android.content.Context
  
  
  override fun onCreate(savedInstanceState: Bundle?) {
      super.onCreate(savedInstanceState)
      setContentView(R.layout.activity_main)
      logd("onCreate MainActivity")
      setSupportActionBar(toolbar)
      ...
  } 
  ...
  override fun onCreateOptionsMenu(menu: Menu): Boolean {
      menuInflater.inflate(R.menu.options_menu, menu)
      val searchManager = getSystemService(Context.SEARCH_SERVICE) as SearchManager
      val searchView = menu.findItem(R.id.search).actionView as? SearchView
      searchView!!.setSearchableInfo(searchManager.getSearchableInfo(componentName))
      return true
  }
  </code></pre>
  
  <p>i am using custom toolbar like this but i think problem is not here</p>