I am using Google's PlaceAutoCompleteFragment in a recent project that I am currently working on. When I click on the PlaceAutoCompleteFragment very quickly it open multiple overlays on my app which is really annoying. how can I prevent it from opening multiple overlays? My code for the fragment is given below:
if (autocompleteFragment == null) {
autocompleteFragment = (PlaceAutocompleteFragment)getFragmentManager().findFragmentById(R.id.place_autocompletehome_fragment);
}
autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() {
@Override
public void onPlaceSelected(Place place) {
// TODO: Get info about the selected place.
try {
Log.i("esty", "Place: " + place.getName());
} catch (Exception e) {
Log.e("esty", "Error: " + e.getMessage());
}
}
@Override
public void onError(Status status) {
// TODO: Handle the error.
Log.e("esty", "An error occurred: " + status);
}
});