0

I want a solution for this issue please suggest what to do , I want search result of a Specific country only from google's PlaceAutocomplete , how can i set filter so that it only shows result for a that country only like If i want search result if available for India only how it can be done? Is it possible with PlaceAutocomplete ?

code :

try {
        Intent intent = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_OVERLAY).build(activity);
        startActivityForResult(intent, 1);
    } catch (GooglePlayServicesRepairableException e) {
        e.printStackTrace();
    } catch (GooglePlayServicesNotAvailableException e) {
        e.printStackTrace();
    }

as in screenshot it shows result of world wide, i only want of a specific country

as in screenshot it shows result of world wide, i only want of a specific country

Kapil Rajput
  • 11,429
  • 9
  • 50
  • 65

2 Answers2

1

You could to use LatLngBounds constructor method. This would help you to restrict the search for a rectangular area (But this would not necessarily restrict the search for one country but all the countries in that rectangular area). Or you could use the Google Places Web Service API as shown here

For more explanation please refer to this answer here

Community
  • 1
  • 1
Visahan
  • 1,130
  • 2
  • 14
  • 35
0

For search place of current city you have to set LatLongBounds to PLaceAutocomplete like. see my ans here Google Places API not returning suggestions based on location

Mahesh Gawhane
  • 348
  • 3
  • 20