Android PlaceAutocompleteFragment自动关闭

问题描述 投票:1回答:1

我正在尝试实现PlaceAutocompleteFragment的地方,但是问题是在单击搜索栏上PlaceAutocompleteFragment的打开时间不足1秒之后。然后自动关闭。我也尝试了SupportPlaceAutocompleteFragment。这是我的代码

<fragment
        android:id="@+id/place_autocomplete_fragment"
        android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

 PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment)
                getFragmentManager().findFragmentById(R.id.place_autocomplete_fragment);


<meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value=".........."/>

注意:我在控制台中启用了位置搜索api,并且还在我的项目中实现了位置和位置服务。

java android google-maps search google-places-api
1个回答
0
投票

Android版Places SDK引入了具有更新功能的全新静态库。 Android版Places SDK的Google Play服务版本(即com.google.android.gms:play-services-places)已于2019年1月29日弃用,并将于2019年7月29日关闭。新版本适用于Android的Places SDK现已可用。

Migrating to the New Places SDK Client

© www.soinside.com 2019 - 2024. All rights reserved.