【发布时间】:2013-05-01 11:22:02
【问题描述】:
我在看雷达城的例子:
我已经实现了 ILocationListener 并启用了位置传感器 并且还通过 onResume 方法启用了位置传感器:
@Override
protected synchronized void onResume()
{
super.onResume();
System.gc();
final LocationSensorOptions locationSensorOptions = new LocationSensorOptions();
locationSensorOptions.setAccuracy(Criteria.ACCURACY_COARSE);
locationSensorOptions.setMinimumTriggerTime(0);
locationSensorOptions.setMinimumTriggerDistance(0);
this.enableLocationSensor(this, locationSensorOptions);
}
然后尝试通过实现的方法获取位置更改的位置
@Override
public void onLocationChanged(Location plocation) {
this.mUserLocation = plocation;
curlng = mUserLocation.getLongitude();
curlat = mUserLocation.getLatitude();
}
但我只得到零,我有点困惑是使用andengine内置的位置传感器还是使用android原生位置传感器?
【问题讨论】: