com.google.android.gms.location.places.ui.PlaceAutocompleteFragment

Here are the examples of the java api class com.google.android.gms.location.places.ui.PlaceAutocompleteFragment taken from open source projects.

1. MainActivity#onCreate()

Project: android-play-places
File: MainActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    // Retrieve the PlaceAutocompleteFragment.
    PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment) getFragmentManager().findFragmentById(R.id.autocomplete_fragment);
    // Register a listener to receive callbacks when a place has been selected or an error has
    // occurred.
    autocompleteFragment.setOnPlaceSelectedListener(this);
    // Retrieve the TextViews that will display details about the selected place.
    mPlaceDetailsText = (TextView) findViewById(R.id.place_details);
    mPlaceAttribution = (TextView) findViewById(R.id.place_attribution);
}