本文整理汇总了Java中android.net.Uri.Builder.build方法的典型用法代码示例。如果您正苦于以下问题:Java Builder.build方法的具体用法?Java Builder.build怎么用?Java Builder.build使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.net.Uri.Builder
的用法示例。
在下文中一共展示了Builder.build方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildNewUri
import android.net.Uri.Builder; //导入方法依赖的package包/类
private Uri buildNewUri(Uri uri, String targetAuthority) {
Builder b = new Builder();
b.scheme(uri.getScheme());
b.authority(targetAuthority);
b.path(uri.getPath());
if (VERSION.SDK_INT >= 11) {
Set<String> names = uri.getQueryParameterNames();
if (names != null && names.size() > 0) {
for (String name : names) {
if (!TextUtils.equals(name, ApkConstant.EXTRA_TARGET_AUTHORITY)) {
b.appendQueryParameter(name, uri.getQueryParameter(name));
}
}
}
} else {
b.query(uri.getQuery());
}
b.fragment(uri.getFragment());
return b.build();
}
示例2: removeFilters
import android.net.Uri.Builder; //导入方法依赖的package包/类
/**
* Removes any path elements that begin with a digit
*
* @param uri
* The {@link Uri} that should be formatted
* @return The formatted Uri.
*/
private Uri removeFilters(Uri uri) {
// Remove any prior filters by only copying the segment of the path
// that does not start with a number.
Builder builder = uri.buildUpon();
builder.path(null);
List<String> pathSegments = uri.getPathSegments();
for (String pathSegment : pathSegments) {
if (!Character.isDigit(pathSegment.charAt(0))) {
builder.appendPath(pathSegment);
} else {
break;
}
}
builder.appendPath("");
return builder.build();
}
示例3: setEmptyPassphrase
import android.net.Uri.Builder; //导入方法依赖的package包/类
public static boolean setEmptyPassphrase(Context ctx, boolean noCreate) {
String pkey = "";
Uri uri = Provider.CONTENT_URI_WITH_ACCOUNT;
Builder builder = uri.buildUpon().appendQueryParameter(ImApp.CACHEWORD_PASSWORD_KEY, pkey);
if (noCreate) {
builder.appendQueryParameter(ImApp.NO_CREATE_KEY, "1");
}
uri = builder.build();
Cursor cursor = ctx.getContentResolver().query(uri, null, null, null, null);
if (cursor != null) {
cursor.close();
return true;
}
return false;
}
示例4: startDisambiguationQuery
import android.net.Uri.Builder; //导入方法依赖的package包/类
/**
* Internal method to query for contacts with a given display name.
*
* @param contactDisplayName the display name to look for.
*/
private void startDisambiguationQuery(String contactDisplayName) {
// Apply a limit of 1 result to the query because we only need to
// determine whether or not at least one other contact has the same
// name. We don't need to find ALL other contacts with the same name.
final Builder builder = RawContacts.CONTENT_URI.buildUpon();
builder.appendQueryParameter("limit", String.valueOf(1));
final Uri uri = builder.build();
final String displayNameSelection;
final String[] selectionArgs;
if (TextUtils.isEmpty(contactDisplayName)) {
displayNameSelection = RawContacts.DISPLAY_NAME_PRIMARY + " IS NULL";
selectionArgs = new String[] { String.valueOf(mContactId) };
}
else {
displayNameSelection = RawContacts.DISPLAY_NAME_PRIMARY + " = ?";
selectionArgs = new String[] { contactDisplayName, String.valueOf(mContactId) };
}
mQueryHandler.startQuery(TOKEN_DISAMBIGUATION_QUERY, null, uri,
new String[] { RawContacts._ID }, // unused projection but a valid one was needed
displayNameSelection + " AND " + RawContacts.PHOTO_ID + " IS NULL AND "
+ RawContacts._ID + " <> ?", selectionArgs, null);
}
示例5: buildThidLoginAndBind
import android.net.Uri.Builder; //导入方法依赖的package包/类
public HTTPAgent buildThidLoginAndBind(String appId, String account, String pwd, String tappname, String tappid, String tuid, String tnickname, String ttoken) {
Builder ub = getBuilder("uac/m/third", "method", "bind4login");
HTTPAgent.Builder hb = new HTTPAgent.Builder();
append(hb, "appid", appId);
append(hb, "account", account);
append(hb, "pwd", pwd);
append(hb, "tappname", tappname);
append(hb, "tappid", tappid);
append(hb, "tnickname", tnickname);
append(hb, "tuid", tuid);
append(hb, "ttoken", ttoken);
return new PostAgent(ub.build(), Passport.getHosts(), hb.buildJSON());
}
示例6: buildupdateDeviceId
import android.net.Uri.Builder; //导入方法依赖的package包/类
public HTTPAgent buildupdateDeviceId(String uid, String tkt, String newdevid, String olddevid, String appid) {
Builder ub = getBuilder("uac/m/update_devid");
HTTPAgent.Builder hb = new HTTPAgent.Builder();
append(hb, "uid", uid);
append(hb, "tkt", tkt);
append(hb, "newdevid", newdevid);
append(hb, "olddevid", olddevid);
append(hb, "appid", appid);
return new PostAgent(ub.build(), Passport.getHosts(), hb.buildJSON());
}
示例7: buildGetFreeCall
import android.net.Uri.Builder; //导入方法依赖的package包/类
public HTTPAgent buildGetFreeCall(String appid, String uid, String tkt, String type, String phone, String loginSource) {
Builder ub = getBuilder("uac/m/freecall/get_freecall360_info");
HTTPAgent.Builder hb = new HTTPAgent.Builder();
append(hb, "appid", appid);
append(hb, "uid", uid);
append(hb, "tkt", tkt);
append(hb, "type", type);
append(hb, "phone", phone);
append(hb, "loginSource", loginSource);
return new PostAgent(ub.build(), Passport.getHosts(), hb.buildJSON());
}
示例8: buildRelogin
import android.net.Uri.Builder; //导入方法依赖的package包/类
public HTTPAgent buildRelogin(String uid, String password, String appId) {
Builder ub = getBuilder("uac/m/relogin");
HTTPAgent.Builder hb = new HTTPAgent.Builder();
append(hb, "uid", uid);
append(hb, "pwd", password);
append(hb, "appid", appId);
return new PostAgent(ub.build(), Passport.getHosts(), hb.buildJSON());
}
示例9: buildLogin4app
import android.net.Uri.Builder; //导入方法依赖的package包/类
public HTTPAgent buildLogin4app(String uid, String rtkt, String appId) {
Builder ub = getBuilder("uac/m/login4app");
HTTPAgent.Builder hb = new HTTPAgent.Builder();
append(hb, "uid", uid);
append(hb, "rtkt", rtkt);
append(hb, "appid", appId);
return new PostAgent(ub.build(), Passport.getHosts(), hb.buildJSON());
}
示例10: buildLoginThird
import android.net.Uri.Builder; //导入方法依赖的package包/类
public HTTPAgent buildLoginThird(String account, String password, String appId) {
Builder ub = getBuilder("uac/m/login");
HTTPAgent.Builder hb = new HTTPAgent.Builder();
append(hb, "account", account);
append(hb, "pwd", password);
append(hb, "appid", appId);
return new PostAgent(ub.build(), Passport.getHosts(), hb.buildJSON());
}
示例11: buildGetDetailScoreInfo
import android.net.Uri.Builder; //导入方法依赖的package包/类
public HTTPAgent buildGetDetailScoreInfo(String uid, String tkt, String appId) {
Builder ub = getBuilder("uac/m/score/get_detail_score_info");
HTTPAgent.Builder hb = new HTTPAgent.Builder();
append(hb, "uid", uid);
append(hb, "tkt", tkt);
append(hb, "appid", appId);
return new PostAgent(ub.build(), Passport.getHosts(), hb.buildJSON());
}
示例12: buildCheckTKT
import android.net.Uri.Builder; //导入方法依赖的package包/类
public PostAgent buildCheckTKT(String uid, String account, String tkt, String appId) {
Builder ub = getBuilder("uac/m/check_tkt");
HTTPAgent.Builder hb = new HTTPAgent.Builder();
append(hb, "uid", uid);
append(hb, "account", account);
append(hb, "tkt", tkt);
append(hb, "appid", appId);
return new PostAgent(ub.build(), Passport.getHosts(), hb.buildJSON());
}
示例13: buildGetCaptchaImg
import android.net.Uri.Builder; //导入方法依赖的package包/类
public HTTPAgent buildGetCaptchaImg(String appid, String captchakey, String width, String height, String length) {
Builder ub = getBuilder("uac/m/authcode/getcaptcha");
append(ub, "appid", appid);
append(ub, "captchakey", captchakey);
append(ub, SettingsJsonConstants.ICON_WIDTH_KEY, width);
append(ub, SettingsJsonConstants.ICON_HEIGHT_KEY, height);
append(ub, DownloadVideoTable.COLUMN_LENGTH, length);
append(ub, "checkkey", EncryptUtils.getMD5String("[email protected]#" + captchakey));
return new ImageAgent(ub.build(), Passport.getHosts());
}
示例14: buildBindPhoneGetActivateCodeSafe
import android.net.Uri.Builder; //导入方法依赖的package包/类
public HTTPAgent buildBindPhoneGetActivateCodeSafe(String phone, String appId, String captchakey, String captchacode) {
Builder ub = getBuilder("uac/m/bind/phone/get_activate_code_safe");
HTTPAgent.Builder hb = new HTTPAgent.Builder();
append(hb, "phone", phone);
append(hb, "appid", appId);
append(hb, "captchakey", captchakey);
append(hb, "captchacode", captchacode);
return new PostAgent(ub.build(), Passport.getHosts(), hb.buildJSON());
}
示例15: buildUpdateUserItem
import android.net.Uri.Builder; //导入方法依赖的package包/类
public HTTPAgent buildUpdateUserItem(String uid, String tkt, String key, String value, String appId) {
Builder ub = getBuilder("uac/m/change/user_info");
HTTPAgent.Builder hb = new HTTPAgent.Builder();
append(hb, "uid", uid);
append(hb, "tkt", tkt);
append(hb, key, value);
append(hb, "appid", appId);
return new PostAgent(ub.build(), Passport.getHosts(), hb.buildJSON());
}