• 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
Mar 26, 2019
242
92
Raleigh, NC
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
 
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.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones