@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  if (requestCode == REQUEST_CODE_AUTOCOMPLETE) {
    if (resultCode == RESULT_OK) {
      Place place=PlaceAutocomplete.getPlace(this,data);
      Log.i(TAG,"Place Selected: " + place.getName());
      mPlaceDetailsText.setText(formatPlaceDetails(getResources(),place.getName(),place.getId(),place.getAddress(),place.getPhoneNumber(),place.getWebsiteUri()));
      CharSequence attributions=place.getAttributions();
      if (!TextUtils.isEmpty(attributions)) {
        mPlaceAttribution.setText(Html.fromHtml(attributions.toString()));
      }
 else {
        mPlaceAttribution.setText("");
      }
    }
 else     if (resultCode == PlaceAutocomplete.RESULT_ERROR) {
      Status status=PlaceAutocomplete.getStatus(this,data);
      Log.e(TAG,"Error: Status = " + status.toString());
    }
 else     if (resultCode == RESULT_CANCELED) {
    }
  }
}

@ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { super . onActivityResult ( requestCode , resultCode , data ) ; if ( requestCode == REQUEST_CODE_AUTOCOMPLETE ) { if ( resultCode == RESULT_OK ) { Place place = PlaceAutocomplete . getPlace ( this , data ) ; Log . i ( TAG , "Place Selected: " + place . getName ( ) ) ; mPlaceDetailsText . setText ( formatPlaceDetails ( getResources ( ) , place . getName ( ) , place . getId ( ) , place . getAddress ( ) , place . getPhoneNumber ( ) , place . getWebsiteUri ( ) ) ) ; CharSequence attributions = place . getAttributions ( ) ; if ( ! TextUtils . isEmpty ( attributions ) ) { mPlaceAttribution . setText ( Html . fromHtml ( attributions . toString ( ) ) ) ; } else { mPlaceAttribution . setText ( "" ) ; } } else if ( resultCode == PlaceAutocomplete . RESULT_ERROR ) { Status status = PlaceAutocomplete . getStatus ( this , data ) ; Log . e ( TAG , "Error: Status = " + status . toString ( ) ) ; } else if ( resultCode == RESULT_CANCELED ) { } } }
called after the autocomplete activity has finished to return its result .
