String placeAddress = String.format("Address: %s", place.getAddress());
String toastMsg = String.format("Place: %s", place.getName()); String address = String.valueOf(place.getAddress()); String placeName = String.valueOf(place.getName());
Double latitude, longitude; String placeName, address; protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == PLACE_PICKER_REQUEST) { if (resultCode == RESULT_OK) { Place place = PlacePicker.getPlace(data, this); latitude = place.getLatLng().latitude; longitude = place.getLatLng().longitude; placeName = String.valueOf(place.getName()); address = String.valueOf(place.getAddress()); if (mMap != null) { LatLng loc2 = new LatLng(latitude, longitude); marker2 = mMap.addMarker(new MarkerOptions().position(loc2).title(placeName.toString()).visible(true)); mMap.moveCamera(CameraUpdateFactory.newLatLng(new LatLng(latitude, longitude))); } } } }
final Place place = PlacePicker.getPlace(this, data); List<Integer> types = place.getPlaceTypes(); for(Integer i : types){ if (i == Place.TYPE_RESTAURANT){ // its restaurant do something final CharSequence name = place.getName(); final CharSequence address = place.getAddress(); String attributions = (String) place.getAttributions(); if (attributions == null) { attributions = ""; } mName.setText(name); mAddress.setText(address); mAttributions.setText(Html.fromHtml(attributions)); } }
mAddressTextView.setText(Html.fromHtml(place.getAddress() + "")); mIdTextView.setText(Html.fromHtml(place.getId() + "")); mPhoneTextView.setText(Html.fromHtml(place.getPhoneNumber() + ""));
protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == PLACE_PICKER_REQUEST && resultCode == Activity.RESULT_OK) { final Place place = PlacePicker.getPlace(this, data); final CharSequence name = place.getName(); final CharSequence address = place.getAddress(); String attributions = (String) place.getAttributions(); if (attributions == null) { attributions = ""; } tv4.setText(place.getLatLng().toString()+"\n"+name+"\n"+address+"\n"+attributions); // Add this line to make the lite map show the location you just chose // and set the zoom level (10f is arbitrary) mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(place.getLatLng(), 10f)); } else { super.onActivityResult(requestCode, resultCode, data); } }
mAddressTextView.setText(Html.fromHtml(place.getAddress() + "")); mIdTextView.setText(Html.fromHtml(place.getId() + "")); mPhoneTextView.setText(Html.fromHtml(place.getPhoneNumber() + ""));
place.getName(),place.getId(), place.getAddress(), place.getPhoneNumber(),place.getWebsiteUri()); MY_ADDRESS=place.getName().toString();
.position(myPlace.getLatLng()) .title(myPlace.getName().toString()) .snippet(myPlace.getAddress().toString())); mMap.moveCamera(CameraUpdateFactory.newLatLng(myPlace.getLatLng()));