【发布时间】:2019-02-08 18:29:03
【问题描述】:
我尝试在 adnroid 上使用来自谷歌的新地点 SDK
这是我用来启动意图的代码
我从这里得到代码
https://developers.google.com/places/android-sdk/client-migration
它会通过自动完成来触发意图,但每次我写一些东西时都会说:
E/Places:自动完成时出错:OVER_QUERY_LIMIT
我不明白我花了一整天的时间来做一些工作。我还尝试了按名称自动完成获取地点,但它只返回来自美国的结果。
你们中的任何开发人员有没有让这个工作? 我现在真的很沮丧:)
if (!Places.isInitialized()) {
Places.initialize(getApplicationContext(), "YOUR_API_KEY");
}
// Set the fields to specify which types of place data to return.
List<Place.Field> fields = Arrays.asList(Place.Field.ID,
Place.Field.NAME);
// Start the autocomplete intent.
Intent intent = new Autocomplete.IntentBuilder(
AutocompleteActivityMode.FULLSCREEN, fields)
.build(this);
startActivityForResult(intent, AUTOCOMPLETE_REQUEST_CODE);
【问题讨论】:
标签: android google-maps google-places-api google-geocoding-api