I'm migrating to the new New Places SDK Client in my android app. I'm trying not to use the compatibility library, but rather use all the new objects. The only feature I use from the SDK is the builtin Autocomplete activity.
I managed to create the Autocomplete.IntentBuilder
and I see that it has a setLocationBias()
method just like the previous PlaceAutocomplete.IntentBuilder
.
However this method takes as a parameter an interface LocationBias
that only extends Parcelable
and has no members of its own so I'm not sure how to implement it, or how to mention the location that I need in it.
Any help is appreciated.
LocationBias takes RectangularBounds. you need to create two LatLng objects with north east & south west coordinates for the bounds and instantiate the RectangularBounds object with them:
val northEast = LatLng(double, double)
val southWest = LatLng(double, double)
and pass it to:
RectangularBounds.newInstance(southWest, northEast);