title: Get address from latitude/longitude Android?
body: <p>So I've tried many different solutions as found online and on StackOverflow but I just can't seem to get this to work. Here is what I am working with right now which I have from a similar post on SO. What am I doing wrong?</p>
  
  <pre><code>public void getLocationName() {
  
      String strAdd = "";
      Geocoder geocoder = new Geocoder(this, Locale.getDefault());
      try {
          List&lt;Address&gt; addresses = geocoder.getFromLocation(49.123124, -122.652404, 1);
          if (addresses != null) {
              Address returnedAddress = addresses.get(0);
              StringBuilder strReturnedAddress = new StringBuilder("");
  
              for (int i = 0; i &lt; returnedAddress.getMaxAddressLineIndex(); i++) {
                  strReturnedAddress.append(returnedAddress.getAddressLine(i)).append("\n");
              }
              strAdd = strReturnedAddress.toString();
              Log.w("My Current loction address", "" + strReturnedAddress.toString());
          } else {
              Log.w("My Current loction address", "No Address returned!");
          }
      } catch (Exception e) {
          e.printStackTrace();
          Log.w("My Current loction address", "Cannot get Address!");
      }
      Toast.makeText(getApplicationContext(), "Distance between two locations is: " + strAdd.toString(), Toast.LENGTH_LONG).show();
  }
  </code></pre>
  
  <p>It always throws the exception, so is it my coordinates?</p>