I have this code:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if(requestCode == MAPA_REQUEST_BAIRRO){
if(resultCode == RESULT_OK){
try {
Place place = PlacePicker.getPlace(this, data);
LatLng latLng = place.getLatLng();
//txtLocalLogradouroB.setText(logradouro +"-"+ bairro);
Geocoder gcd = new Geocoder(getApplicationContext(), Locale.getDefault());
List<Address> addresses1 = null;
List<Address> addresses = null;
double um= Double.parseDouble(latitude);
double dois = Double.parseDouble(longitude);
addresses1 = gcd.getFromLocation(um, dois, 1);
// }
if (addresses1.size() > 0) {
br = addresses1.get(0).getSubLocality();
lg = addresses1.get(0).getThoroughfare();
txtLocalLogradouroB.setText(lg + "-"+br);
}
But it does not work. I have latitude and longitude that comes from a webservice but I want to convert these values to get the address and show to the user could anyone help me please? :)