【问题标题】:Restricted bias in Address search android地址搜索android中的受限偏差
【发布时间】:2017-09-30 13:58:34
【问题描述】:

在我们的 android 应用中,我们使用自动完成小部件来使用意图搜索地址。我们希望限制特定国家/地区的搜索结果(例如,仅在印度境内显示搜索结果)。 尽管我们将结果偏向于特定区域(例如城市:钦奈),但我们仍然会在国外获得结果以及在国内获得结果。 我们希望我们的客户只在国内查看结果。如果我们在places api中使用自动完成小部件,这不会发生。请帮助我们解决这个问题。

【问题讨论】:

标签: android autocomplete widget google-places-api country


【解决方案1】:
AutocompleteFilter filter = new AutocompleteFilter.Builder().setCountry("SD").build();
Intent intent = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_OVERLAY)
                .setFilter(filter)
                .build(ChooseLocationActivity.this);
startActivityForResult(intent, PLACE_AUTOCOMPLETE_REQUEST_CODE);

Here is a list of country codes

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多