本文整理汇总了Java中android.net.Uri.Builder.appendEncodedPath方法的典型用法代码示例。如果您正苦于以下问题:Java Builder.appendEncodedPath方法的具体用法?Java Builder.appendEncodedPath怎么用?Java Builder.appendEncodedPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.net.Uri.Builder
的用法示例。
在下文中一共展示了Builder.appendEncodedPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSearchManagerSuggestions
import android.net.Uri.Builder; //导入方法依赖的package包/类
Cursor getSearchManagerSuggestions(SearchableInfo searchable, String query, int limit) {
if (searchable == null) {
return null;
}
String authority = searchable.getSuggestAuthority();
if (authority == null) {
return null;
}
Builder uriBuilder = new Builder().scheme(Utils.RESPONSE_CONTENT).authority(authority).query("").fragment("");
String contentPath = searchable.getSuggestPath();
if (contentPath != null) {
uriBuilder.appendEncodedPath(contentPath);
}
uriBuilder.appendPath("search_suggest_query");
String selection = searchable.getSuggestSelection();
String[] selArgs = null;
if (selection != null) {
selArgs = new String[]{query};
} else {
uriBuilder.appendPath(query);
}
if (limit > 0) {
uriBuilder.appendQueryParameter("limit", String.valueOf(limit));
}
return this.mContext.getContentResolver().query(uriBuilder.build(), null, selection, selArgs, null);
}
示例2: getBuilder
import android.net.Uri.Builder; //导入方法依赖的package包/类
protected Builder getBuilder(String path, String key, String value) {
Builder ub = new Builder();
ub.appendEncodedPath(path);
append(ub, key, value);
addCommonParam(ub);
return ub;
}
示例3: m2692a
import android.net.Uri.Builder; //导入方法依赖的package包/类
Cursor m2692a(SearchableInfo searchableInfo, String str, int i) {
if (searchableInfo == null) {
return null;
}
String suggestAuthority = searchableInfo.getSuggestAuthority();
if (suggestAuthority == null) {
return null;
}
String[] strArr;
Builder fragment = new Builder().scheme("content").authority(suggestAuthority).query("").fragment("");
String suggestPath = searchableInfo.getSuggestPath();
if (suggestPath != null) {
fragment.appendEncodedPath(suggestPath);
}
fragment.appendPath("search_suggest_query");
String suggestSelection = searchableInfo.getSuggestSelection();
if (suggestSelection != null) {
strArr = new String[]{str};
} else {
fragment.appendPath(str);
strArr = null;
}
if (i > 0) {
fragment.appendQueryParameter("limit", String.valueOf(i));
}
return this.d.getContentResolver().query(fragment.build(), null, suggestSelection, strArr, null);
}