My search bar of PlaceAutoComplete loses focus when being clicked. Sometimes it's possible to click and search but it doesn't find any place and then loses focus again.
I already tried to follow the solution presented here: Android Google Places API, getAutocompletePredictions returns status 'PLACES_API_ACCESS_NOT_CONFIGURED'
I have an activity with both Google maps fragment and Google places fragment:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MapsActivity"
android:orientation="vertical"
android:weightSum="1">
<fragment
android:id="@+id/place_autocomplete"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
/>
<fragment
android:id="@+id/map"
class="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
I enabled the Google Places in my google developer console:
And of course I'm using the API key, and it's done correctly since the Google Maps functionality is working:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
Could it be a dependency issue? My relevant dependencies:
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-places:17.0.0'
implementation 'com.google.android.libraries.places:places-compat:2.2.0'
I added the places-compat (last dependency) just because someone adviced for it, but it didn't help.
What could cause this problem? Thanks