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

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -