簡體   English   中英

Android PlaceAutocompleteFragment 自動關閉

[英]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 現在可用。

遷移到新地方 SDK 客戶端

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM