本文整理汇总了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;
}