本文整理匯總了Java中com.facebook.Request.getParameters方法的典型用法代碼示例。如果您正苦於以下問題:Java Request.getParameters方法的具體用法?Java Request.getParameters怎麽用?Java Request.getParameters使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.facebook.Request
的用法示例。
在下文中一共展示了Request.getParameters方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createRequest
import com.facebook.Request; //導入方法依賴的package包/類
private Request createRequest(String userID, Set<String> extraFields, Session session) {
Request request = Request.newGraphPathRequest(session, userID + "/friends", null);
Set<String> fields = new HashSet<String>(extraFields);
String[] requiredFields = new String[]{
ID,
NAME
};
fields.addAll(Arrays.asList(requiredFields));
String pictureField = adapter.getPictureFieldSpecifier();
if (pictureField != null) {
fields.add(pictureField);
}
Bundle parameters = request.getParameters();
parameters.putString("fields", TextUtils.join(",", fields));
request.setParameters(parameters);
return request;
}
示例2: createRequest
import com.facebook.Request; //導入方法依賴的package包/類
private Request createRequest(String userID, Set<String> extraFields, Session session) {
Request request = Request.newGraphPathRequest(session, userID + friendPickerType.getRequestPath(), null);
Set<String> fields = new HashSet<String>(extraFields);
String[] requiredFields = new String[]{
ID,
NAME
};
fields.addAll(Arrays.asList(requiredFields));
String pictureField = adapter.getPictureFieldSpecifier();
if (pictureField != null) {
fields.add(pictureField);
}
Bundle parameters = request.getParameters();
parameters.putString("fields", TextUtils.join(",", fields));
request.setParameters(parameters);
return request;
}
示例3: createRequest
import com.facebook.Request; //導入方法依賴的package包/類
private Request createRequest(Location location, int radiusInMeters, int resultsLimit, String searchText,
Set<String> extraFields,
Session session) {
Request request = Request.newPlacesSearchRequest(session, location, radiusInMeters, resultsLimit, searchText,
null);
Set<String> fields = new HashSet<String>(extraFields);
String[] requiredFields = new String[]{
ID,
NAME,
LOCATION,
CATEGORY,
WERE_HERE_COUNT
};
fields.addAll(Arrays.asList(requiredFields));
String pictureField = adapter.getPictureFieldSpecifier();
if (pictureField != null) {
fields.add(pictureField);
}
Bundle parameters = request.getParameters();
parameters.putString("fields", TextUtils.join(",", fields));
request.setParameters(parameters);
return request;
}
示例4: getUser
import com.facebook.Request; //導入方法依賴的package包/類
@Override
public void getUser(final Callback<SocialMember> callback) {
if (notifyIfNotLoggedIn(callback)) {
return;
}
//If the profile for the current user has already been fetched use the cached result.
if (userProfile != null) {
callback.onSuccess(userProfile);
return;
}
Session session = Session.getActiveSession();
Request request = Request.newMeRequest(session, new Request.GraphUserCallback() {
@Override
public void onCompleted(GraphUser user, Response response) {
if (!notifyIfError(response, callback)) {
logger.debug(user.getUsername() + ":" + user.getName() + ":" + user.getFirstName()
+ ":" + user.getLastName() + ":" + user.getId());
logger.debug(user.getProperty("email") + "");
SocialMember member = new SocialMember(Long.parseLong(user.getId()), user.getName());
member.setEmail(user.getProperty("email") + "");
callback.onSuccess(member);
}
}
});
Bundle params = request.getParameters();
params.putString("fields", "email,id,name");
request.setParameters(params);
request.executeAsync();
}
示例5: createRequest
import com.facebook.Request; //導入方法依賴的package包/類
private Request createRequest(Session session) {
Request request = Request.newGraphPathRequest(session, "me/friends", null);
Set<String> fields = new HashSet<String>();
String[] requiredFields = new String[] { "id", "name", "picture" };
fields.addAll(Arrays.asList(requiredFields));
Bundle parameters = request.getParameters();
parameters.putString("fields", TextUtils.join(",", fields));
request.setParameters(parameters);
return request;
}