List of usage examples for android.app SearchManager SUGGEST_PARAMETER_LIMIT
String SUGGEST_PARAMETER_LIMIT
To view the source code for android.app SearchManager SUGGEST_PARAMETER_LIMIT.
Click Source Link
From source file:cm.aptoide.com.actionbarsherlock.widget.SuggestionsAdapter.java
public Cursor getSuggestions(String query, int limit) { Uri.Builder uriBuilder = new Uri.Builder().scheme(ContentResolver.SCHEME_CONTENT).query("") // TODO: Remove, workaround for a bug in Uri.writeToParcel() .fragment(""); // TODO: Remove, workaround for a bug in Uri.writeToParcel() // append standard suggestion query path uriBuilder.appendPath(SearchManager.SUGGEST_URI_PATH_QUERY); // inject query, either as selection args or inline uriBuilder.appendPath(query);/*from www. java2s .co m*/ if (limit > 0) { uriBuilder.appendQueryParameter(SearchManager.SUGGEST_PARAMETER_LIMIT, String.valueOf(limit)); } Uri uri = uriBuilder.build(); // finally, make the query return mContext.getContentResolver().query(uri, null, null, null, null); }