pingplacepicker
pingplacepicker copied to clipboard
Search not working
Hi,
I am unable to search the places. I have correctly configured the Android & Map API keys. Whenever I type something in the search box, the search dialog disappears.
Please help me out since I am facing issue in the live app.
Thanks.
In Application class use this below code:
Places.initialize(applicationContext, "your api key")
In Activity class:
val builder = PingPlacePicker.IntentBuilder()
builder.setAndroidApiKey(getStr(R.string.google_maps_key))
.setMapsApiKey(getStr(R.string.google_maps_key))
try {
val placeIntent = builder.build(this)
startActivityForResult(placeIntent, 1001)
}
catch (ex: Exception) {
ShowToast("Google Play Services is not Available", this)
}
For me, I had to add the Places API to my Android app key, not just the Maps API key like it says in the docs.