【发布时间】:2015-12-03 14:34:34
【问题描述】:
我正在使用改造来在线获取数据。但是我找不到任何解决问题的方法。我想调用另一个片段并显示有关我单击的标记的更多详细信息,并将这些值传递给另一个片段。有人可以帮我解决这个问题。非常感谢任何帮助和解决方案。
MapFragment.jav
RestAdapter adapter = new RestAdapter.Builder()
.setEndpoint(getString(R.string.fine_dinings))
.build();
RestaurantPlacesApiInterface restaurantPlacesApiInterface =
adapter.create(RestaurantPlacesApiInterface.class);
restaurantPlacesApiInterface.getStreams(new Callback<List<RestaurantPlaces>>() {
@Override
public void success(List<RestaurantPlaces> restaurantPlaces, Response response) {
for (RestaurantPlaces restaurantPlace : restaurantPlaces){
MarkerOptions options = new MarkerOptions().position(new LatLng(restaurantPlace.getLatitude(),
restaurantPlace.getLongitude()));
options.title(restaurantPlace.getName());
options.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN));
getMap().addMarker(options);
}
}
@Override
public void failure(RetrofitError error) {
}
});
}
【问题讨论】:
标签: android google-maps android-fragments android-intent retrofit