// 请记住按照“备注”部分所述初始化客户端。 Awareness.SnapshotApi.getPlaces(client) .setResultCallback(new ResultCallback<PlacesResult>() { @Override public void onResult(@NonNull PlacesResult placesResult) { List<PlaceLikelihood> likelihoodList = placesResult.getPlaceLikelihoods(); if (likelihoodList == null || likelihoodList.isEmpty()) { Log.e(getClass().getSimpleName(), "No likely places"); } } });
至于在那些地方获取数据,这里有一些选择:
Place place = placeLikelihood.getPlace(); String likelihood = placeLikelihood.getLikelihood(); Place place = likelihood.getPlace(); String placeName = place.getName(); String placeAddress = place.getAddress(); String placeCoords = place.getLatLng(); String locale = extractFromLocale(place.getLocale()));