Getting street name from Address/Location object in Android

前端 未结 6 761
滥情空心
滥情空心 2021-01-31 11:34

I\'m trying to get the street name of my current location but I can\'t seem to get it.

I use this method to retrieve the Address:

public Address getAddre         


        
6条回答
  •  闹比i
    闹比i (楼主)
    2021-01-31 11:56

    getFromLocation wasn't working for me either. There are a couple steps you can take.

    1. First off go into gradle and make sure you are using the latest play services lib.

    2. Don't over specify, the reason I got no results is because I had to much info in my address. When I removed the postal code I got results every time.

    3. Try the online api: http://maps.google.com/maps/api/geocode/json?address=192%20McEwan%20Dr%20E,%20Caledon,%20ON&sensor=false Just replace the address in there with yours.

    Good luck

提交回复
热议问题