3
我看着雷達例如城市的例子:AndEngine位置
,我已經實現了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原生位置傳感器?