0
我从使用mylocation类的GPS提供商获取数据。代码是这样的:Android mapview的地点差异模拟器和设备
MyLocation.LocationResult locationResult = new MyLocation.LocationResult() {
@Override
public void gotLocation(Location location) {
//Got the location!
// for phone
//currentLocation = new GeoPoint((int) (location.getLatitude() * 1000000),
// (int) (location.getLongitude() * 1000000));
// for emulator
currentLocation = new GeoPoint((int) (location.getLatitude()),
(int) (location.getLongitude()));
doSomething();
}
};
MyLocation myLocation = new MyLocation();
myLocation.getLocation(this, locationResult);
当我在模拟器(2.3.3)中使用应用程序时,它显示正确的位置而不会乘以任何东西。
但是当我使用它在一个设备(4.0)lat和lon需要乘以1000000.我无法找到原因。我不认为它是因为android的版本。任何人有任何想法?
我按照你的说法试过,但它不能在模拟器中工作。如果设备没有问题,如果它只在模拟器上出现问题,那对我来说就没有问题。有没有可能在每个设备上表现出不同的表现?例如对于android 2.3和4.0? – eluleci 2012-07-31 18:20:13
不应该根据文档 – Kaediil 2012-07-31 18:21:52