Skip to content

Instantly share code, notes, and snippets.

@lagner
Created January 12, 2021 09:15
Show Gist options
  • Save lagner/8cff771aeb1c252b38b7fde85e3e7f42 to your computer and use it in GitHub Desktop.
Save lagner/8cff771aeb1c252b38b7fde85e3e7f42 to your computer and use it in GitHub Desktop.
val searchManager = SearchManager.createOnlineManager(sdkContext)!!
val query = SuggestQueryBuilder
.fromQueryText("Домодедово")
.build()!!
searchManager.suggest(query).onResult {
val result = it ?: return@onResult
result.suggests().filterNotNull().forEach {
val ptr = it.handler()
if (ptr is SuggestObjectHandler) {
Log.i("##", "- ${ptr.item()?.address()}")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment