Search code examples
androidandroid-searchmanager

Android SearchManager: How to set minimum number of characters to enable the Search


I am using the Android SearchManager. I defined all the needed attributes in the searchable.xml.

Now, I would like to set a limit for minimum numer of characters before the user can make the search. By default, the min is 1.

How can this be changed?

Thank you.


Solution

  • Its the following attribute in searchable.xml

    <searchable xmlns:android="http://schemas.android.com/apk/res/android"
      ...
      android:searchSuggestThreshold="2"
      >
    </searchable>