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.
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).
Comments
Post a Comment