gps经纬度获取详细地址信息

作为自己的一个记录笔记

if(location!=null){

Geocoder geocoder =newGeocoder(mContext);

try{

List address = geocoder.getFromLocation(location.getLatitude(),location.getLongitude(),1);

if(address!=null&&address.size()>0){

for(inti=0;i

add= address.get(i);

add.getFeatureName();

add.getLocality();

add.getSubLocality();

add.getThoroughfare();

//                                Toast.makeText(mContext, add.getSubLocality()+","+ add.getFeatureName()+","+ add.getLocality()+","+add.getThoroughfare(), Toast.LENGTH_SHORT).show();

}

}

}catch(IOException e) {

e.printStackTrace();

}

}

你可能感兴趣的:(gps经纬度获取详细地址信息)