6

I am creating an Android Application. In that I am using PlaceAutocomplete.IntentBuilder to get address from Google.

I want to change the hint text of search box in PlaceAutocomplete view.

I am using below code for opening the PlaceAutocomplete view.

Intent intent = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_OVERLAY).build(this);
startActivityForResult(intent, requestCode);

Screen shot:

enter image description here

Sagar Zala
  • 4,854
  • 9
  • 34
  • 62
  • 1
    check this [link](https://developers.google.com/android/reference/com/google/android/gms/location/places/ui/PlaceAutocompleteFragment#public-methods). In this link there is setHint() to change hint. – Surender Kumar May 30 '16 at 11:37
  • @SurenderKumar, Its indirectly calls the PlaceAutocomplete class – Sagar Zala May 30 '16 at 12:50
  • Please check out for the solution : [How to change google places search hint text](https://stackoverflow.com/questions/45366037/how-to-change-placeholder-text-in-an-autocomplete-activity-of-android-google-pla/47752403#47752403) – Maddy Sharma Dec 11 '17 at 12:04

1 Answers1

3

For the new Autocomplete.IntentBuilder, you can override the hint string in your strings.xml file.

<string name="places_autocomplete_search_hint">SOME HINT TEXT</string>

I have not tested it on the old PlaceAutocomplete.IntentBuilder, however.

rednuht
  • 1,724
  • 16
  • 27