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


i using option 2: use intent launch autocomplete activity

is possible change "search" place holder text such "enter city". found a solution javascript, suppose support android well.

it seems done a placeautocompletefragment, using own edittext launch autocomplete using intent, not helpful.

enter image description here

no there no way , if want have create own. u use edittext(mention in comment section) may technique useful your.

code:

placeautocompletefragment autocompletefragment; autocompletefragment = (placeautocompletefragment)             getfragmentmanager().findfragmentbyid(r.id.place_autocomplete_fragment);     autocompletefragment.setonplaceselectedlistener(this);     autocompletefragment.sethint("search new location"); 

xml :

<linearlayout android:layout_width="match_parent" android:layout_height="@dimen/left_drawable_padding" android:layout_margintop="@dimen/margin_five" android:layout_marginleft="@dimen/margin_five" android:layout_marginright="@dimen/margin_five" android:background="@drawable/search_background" android:orientation="vertical">     <fragment         android:id="@+id/place_autocomplete_fragment"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:name="com.google.android.gms.location.places.ui.placeautocompletefragment"         /> 

and used android:background="@drawable/search_background" u have create own background shape(acc. need).

first picture : enter image description here

second picture : enter image description here

thrid picture : enter image description here

fourth picture : enter image description here


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -