SearchView hints not showing for single character typed : <p>I'm working on an Android application written in Scala that uses <code>android.support.v7.widget.SearchView</code> inside the action bar that's overridden by <code>android.support.v7.widget.Toolbar</code>.</p>

<p>In the app, I need to enable search suggestions for that <code>SearchView</code>. So, every time I detect a query change, I check to see if suggestions need to be updated (code below). If the suggestions need to be updated a call is made to the backend and an <code>android.database.MatrixCursor</code> is created that contains the search suggestions and is set on the <code>SearchView</code>s suggestions adapter (code below).</p>

<p>The problem that I'm having with this is that the search hints will not show up when typing a <strong>single</strong> character. Typing two or more characters in the search box works perfectly.  </p>

<p>I've tried with <code>android:searchSuggestThreshold</code> set to <code>0</code> and <code>1</code> in my XML config and I get the same result (like that option being ignored): search hints showing for multiple input characters, but not showing for a single character. </p>

<p>Am I missing something in the config/initialisation of the <code>SearchView</code>? Like an option other than <code>android:searchSuggestThreshold</code> which I can set? I've spent the last few hours on looking for alternative options but couldn't find any.</p>

<p>A possible solution that I see would be getting the <code>AutoCompleteTextView</code> backing the <code>SearchView</code>'s input and setting the threshold for it to 1, but it's an ugly (hack-ish) solution as the <code>AutoCompleteTextView</code> is not exposed by the <code>SearchView</code>s API.</p>

<p>Does anyone know an elegant solution for this? </p>

<p>Thank you!</p>

<p><strong>Detecting search term changes:</strong></p>

<pre><code>//this gets called whenever something is changed in the search box. "s" contains the entire search term typed in the search box
def onQueryTextChange(s: String): Boolean = {
  //this checks to see if a call should be made to the backend to update suggestions
  SearchSuggestionController.query(s) 
  //return false as we're not consuming the event
  false
}
</code></pre>

<p><strong>Updating search suggestions:</strong></p>

<pre><code>def updateSuggestions(suggestions: Array[String]): Unit = {
  val cursor = new MatrixCursor(Array(BaseColumns._ID, SearchManager.SUGGEST_COLUMN_TEXT_1), suggestions.length)
  for{
    i &lt;- suggestions.indices
    s = suggestions(i)
  } cursor.addRow(Array[AnyRef](i.toString, s))

  getActivity.runOnUiThread(() =&gt; {
    searchSuggestionAdapter.changeCursor(cursor)
    searchSuggestionAdapter.notifyDataSetChanged()
  })
}
</code></pre>

<p><strong>Menu SearchView initialization:</strong></p>

<pre><code>override def onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) = {
    inflater.inflate(R.menu.menu_products, menu)
    val searchManager = getActivity.getSystemService(Context.SEARCH_SERVICE).asInstanceOf[SearchManager]
    val actionItem = menu.findItem(R.id.action_search)
    searchView = MenuItemCompat.getActionView(actionItem).asInstanceOf[SearchView]
    searchView.setSearchableInfo(searchManager.getSearchableInfo(getActivity.getComponentName))
    searchView.setSubmitButtonEnabled(false)
    SearchSuggestionController.onSuggestionsProvided_=(updateSuggestions)
    searchView setSuggestionsAdapter searchSuggestionAdapter
    searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { 
      //...
      //change listener for detecting search changes presented above
      //...
    }
  //...
  //initialise other components 
  //...
}
</code></pre>

<p><strong>Searchable config:</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;searchable xmlns:android="http://schemas.android.com/apk/res/android"
    android:label="@string/app_name"
    android:hint="@string/actionbar_products_search_hint"
    android:searchSuggestThreshold="0"
    android:searchSuggestSelection=" ?"/&gt;
</code></pre>
