• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Map search bar closes

23tony

Well-Known Member
I'm trying to get a simple map working, with a search bar to look up a location. It is mostly working, but whenever I open the search bar, it closes on its own after a couple seconds, or immediately when I input anything.

I have searched all over - found several answers on SO addressing this, and I've tried applying all of the solutions offered. So far, I have had no luck.

At one point I got an error message (bad API key, fixed it) referencing Google Maps Android API v2 - but I don't see that anywhere in the API browser in my developer console. I have "Maps SDK for Android", "Directions API', and "Places API" enabled.

From what I've been reading, I think it's related to the API but I don't know what to try next. Any suggestions?

I have
Code:
<meta-data
    android:name="com.google.android.geo.API_KEY"
    android:value="<key>" />
in the <application> section of the manifest, and
Code:
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-locatoin:16.0.0'
implementation 'com.google.android.gms:play-services-places:16-0-0'
in build.gradle
 
:bump:

Anyone here with experience working with the maps and places APIs?

I may have found a workaround, but it loses the dropdown auto-complete, assuming it works (haven't tried yet), but I would really prefer to use what was intended for this.
 
Looks like I'm going to have to roll my own. It seems Google has deprecated the Place Picker and is removing it soon:

https://developers.google.cn/places...ndroid/libraries/places/compat/ui/PlacePicker

The Place Picker is deprecated and is not included in the new Places SDK. In the Compat library it will continue to be exposed, acting as a proxy to launch the Google Play Services Place Picker. See the Place Picker documentation for details on when it will no longer be available.
 
Back
Top Bottom