當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。