问题
i am doing geocoding in android get location from edittext and convert it into lat long and display on map but my address variable and list and has null values my address is like beauty Box A-9/1
my code is
Geocoder gc = new Geocoder(this);
Address d ;
double latitude = 0 ;
double longitude = 0;
try {
List<Address>locname = gc.getFromLocationName(name, 5);
d = locname.get(0);
latitude = d.getLatitude();
longitude= d.getLongitude();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
GeoPoint dest = new GeoPoint((int)(latitude*1E6), (int)(longitude*1E6));
the locname is null i have tried many thing but no help
来源:https://stackoverflow.com/questions/12589329/geocoding-in-android-returns-null-value