こんにちはすべてのGoogle検索バーを使用しようとしている間にエラーが発生しています。 setOnPlaceSelectedListenerを解決できないと言っています。私はこの問題についてオンラインで見つけることができた唯一の解決策であった24歳以上の図書館を使用しています。 ( 'com.android.support:design:25.1.0'をコンパイルしてください)。私はまた、私に何かエラーを与えるこのXMLコードを使用しています。助言がありますか?Cant Resolve setOnPlaceSelectedListener
XML:
<fragment
android:id="@+id/place_autocomplete_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:name="com.google.android.gms.location.places.ui.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.
Log.i(TAG, "Place: " + place.getName());
}
@Override
public void onError(Status status) {
// TODO: Handle the error.
Log.i(TAG, "An error occurred: " + status);
}
});