1
當我點擊Geocode谷歌API與烏克蘭地址它將返回null
在客戶端(在烏克蘭)的一些地址,但是當我在印度(在我身邊)測試它的工作完美。地理編碼谷歌API被卡住時轉換地址到拉長
代碼:
private LatLng getLocationFromAddress(final String place){
LatLng loc = null;
Geocoder gCoder = new Geocoder(getActivity());
try {
final List<Address> list = gCoder.getFromLocationName(place, 1);
if (list != null && list.size() > 0) {
loc = new LatLng(list.get(0).getLatitude(), list.get(0).getLongitude());
}
}
catch (IOException e) {
e.printStackTrace();
}
return loc;
}
顯示我的代碼,沒有代碼我們什麼都不能做。 –