Limiting the number of search suggestions, android -


Is there any way to limit the number of suggestions displayed while using the search interface with custom search suggestions?

Thank you!

This is really very simple.

Firstly define a variable for your content provider for reference:

  public static final string LIMIT_PARAMETER = "LIMIT";   

Define something to keep your boundary value in your cursor query @ override

  string border = Yuri. (LIMIT_PARAMETER);   

then border to SqliteQueryBuilder :

  pass the last cursor cursor = queryBuilder.query ( Db, projection, selection, selection order, blank, empty, sort order, border);   

Then you can use it with contentResolver :

  getContentResolver (). Query (SOME_CONTENT_URI.buildUpon () .appendQueryParameter (YourContentProvider.LIMIT_PARAMETER, yourLimit) .build (), mSuggestionProjection, mSelection, FilterArgArray, ORDER_BY);    

Comments

Popular posts from this blog

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

c++ - Redefined variable in the other module -

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -