【发布时间】:2011-03-29 04:58:03
【问题描述】:
【问题讨论】:
标签: android google-maps geolocation
【问题讨论】:
标签: android google-maps geolocation
double latitude = geoPoint.getLatitudeE6() / 1E6;
double longitude = geoPoint.getLongitudeE6() / 1E6;
location.setLatitude(latitude);
location.setLongitude(longitude);
【讨论】:
1E6 将节省您更多的字符。 — @stealthcopter:不,不是。 Location 显然缺少两个浮点数的构造函数(Location 甚至没有默认构造函数 - 你需要填写一个无用的提供者)。实际上,我会将Location 设为不可变的,例如Date 或String。