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

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -