当前位置: 首页>>代码示例>>Java>>正文


Java Request.newPlacesSearchRequest方法代码示例

本文整理汇总了Java中com.facebook.Request.newPlacesSearchRequest方法的典型用法代码示例。如果您正苦于以下问题:Java Request.newPlacesSearchRequest方法的具体用法?Java Request.newPlacesSearchRequest怎么用?Java Request.newPlacesSearchRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.Request的用法示例。


在下文中一共展示了Request.newPlacesSearchRequest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getNearPlaces

import com.facebook.Request; //导入方法依赖的package包/类
@Override
public void getNearPlaces(Location location, int radius, final ExternalDataListener dataListener) {
	
	final Session session = Session.getActiveSession();
	if (session != null & session.isOpened()) {
		
		// Make an API call to get nearby places and define a new callback to handle the response
		Request request = Request.newPlacesSearchRequest(session, location, (int)radius, 100, "", 
				new GraphPlaceListCallback() {

			@Override
			public void onCompleted(List<GraphPlace> graphPlaces, Response response) {
				List<Place> places =  new ArrayList<Place>();
				for (GraphPlace place : graphPlaces) {
					//Log.v(TAG, place.getInnerJSONObject().toString());
					places.add(createPlace(place));
				}
				dataListener.fireCollectionAdded(places);
			}
		});
		request.executeAsync();
	}
}
 
开发者ID:vegaen,项目名称:UbiNomadLib,代码行数:24,代码来源:FacebookProviders.java

示例2: 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;
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:28,代码来源:PlacePickerFragment.java

示例3: createRequest

import com.facebook.Request; //导入方法依赖的package包/类
private Request createRequest(Location paramLocation, int paramInt1, int paramInt2, String paramString, Set<String> paramSet, Session paramSession)
{
  Request localRequest = Request.newPlacesSearchRequest(paramSession, paramLocation, paramInt1, paramInt2, paramString, null);
  HashSet localHashSet = new HashSet(paramSet);
  localHashSet.addAll(Arrays.asList(new String[] { "id", "name", "location", "category", "were_here_count" }));
  String str = this.adapter.getPictureFieldSpecifier();
  if (str != null)
    localHashSet.add(str);
  Bundle localBundle = localRequest.getParameters();
  localBundle.putString("fields", TextUtils.join(",", localHashSet));
  localRequest.setParameters(localBundle);
  return localRequest;
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:14,代码来源:PlacePickerFragment.java


注:本文中的com.facebook.Request.newPlacesSearchRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。