Restricted bias in Address search android

120 views Asked by At

In our android app, we are using autocomplete widget to search addresses using intent. We would like to restrict search results specific to a country(e.g Showing search result only within India). Though we bias results to a specific region (e.g city : Chennai), we still get results outside the country along with results inside country. We would like our customers to view results only inside country. this is not happening if we use autocomplete widget in places api. Kindly help us to solve this issue.

1

There are 1 answers

0
AudioBubble On
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