![](/img/trans.png)
[英]PlaceAutocompleteFragment not working on Android 5.0 & Up
[英]Android PlaceAutocompleteFragment auto closing
我正在尝试实现 placePlaceAutocompleteFragment 但问题是在单击搜索栏 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,我还在我的项目中实现了地点和位置服务。
用于 Android 的 Places SDK 引入了具有更新功能的全新 static 库。 The Google Play Services version of the Places SDK for Android (ie com.google.android.gms:play-services-places) is deprecated as of January 29, 2019, and will be turned off on July 29, 2019. A new version用于 Android 的地方 SDK 现在可用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.