I am using Google Places API for Android - PlaceAutocompleteFragment API in my project to search locations, when user selects a location then get the records using location la
Looking at the source code of PlaceAutocompleteFragment
I found those view ids and setup a onClickListener
like this:
autocompleteFragment.getView().findViewById(R.id.place_autocomplete_clear_button)
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// example : way to access view from PlaceAutoCompleteFragment
// ((EditText) autocompleteFragment.getView()
// .findViewById(R.id.place_autocomplete_search_input)).setText("");
autocompleteFragment.setText("");
view.setVisibility(View.GONE);
}
});