Search code examples
androidgoogle-places-api

How to change placeholder text in an autocomplete activity of android google place?


I am using Option 2: Use an intent to launch the autocomplete activity

Is it possible to change the "search" place holder text to something such as "enter your city". I found a solution but for javascript, suppose support android as well.

It seems it could be done with a PlaceAutocompleteFragment, but I am using my own EditText to launch autocomplete by using an intent, so it is not helpful.

enter image description here


Solution

  • It seems there is no way to change placeholder text with either auto complete activity or even with PlaceAutocompleteFragment because it also use autocomplete activity inside. The only way is using AutoCompleteTextView that you have full control on it. Google provides full sample code that is also easy to integrate and provide good UX.

    https://github.com/googlesamples/android-play-places/tree/master/PlaceCompleteAdapter

    I create a feature request here, hopefully it will be supported in the future.