![](/img/trans.png)
[英]Android Google Places API - PlaceAutocompleteFragment clear button listener
[英]com.google.android.gms.location.places.ui.placeautocompletefragment is deprecated
placeautocompletefragment
已棄用。 我需要一個替代代碼。 這是代碼示例
PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment)
getFragmentManager().findFragmentById(R.id.place_autocomplete_fragment);
autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() {
@Override
public void onPlaceSelected(Place place) {
// TODO: Get info about the selected place.
destination = place.getName().toString();
destinationLatLng = place.getLatLng();
}
@Override
public void onError(Status status) {
// TODO: Handle the error.
}
});
嘗試遷移到 com.google.android.libraries.places.widget.AutocompleteSupportFragment
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.