Android how to get the street name from an address returned by Geocoder

前端 未结 4 1521
予麋鹿
予麋鹿 2021-02-08 17:36

I\'m using Geocoder in reverse way to get an address from a given lat & lon.

Do you know how to get from Address only the street na

4条回答
  •  终归单人心
    2021-02-08 18:23

    I was searching up the very same thing. I disagree with the answer that was marked as correct. I could be wrong but it would appear that "Thoroughfare" (what a quaint old English term!) is the field that provides the street name. so for example:

    get the addresses:

        List
    addresses = null; addresses = geocoder.getFromLocation(latitude, longitude,1); if(addresses != null && addresses.size() > 0 ){ Address address = addresses.get(0); // Thoroughfare seems to be the street name without numbers String street = address.getThoroughfare(); }

提交回复
热议问题