小编Apo*_*ias的帖子

新的 Google 地方信息自动完成功能不起作用?

我尝试在 adnroid 上使用来自 google 的新地方 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);
Run Code Online (Sandbox Code Playgroud)

android google-maps google-geocoding-api google-places-api

-1
推荐指数
1
解决办法
3460
查看次数