我正在使用Android GPS应用程序,我发现,在某些设备上,例如micromax,碳,我无法通过位置管理器或使用它的API来获得经度,经度<\ n <。< / p>
LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
LocationListener locationListener = new LocationListener()
{
public void onLocationChanged(Location location)
{
double latitude = location.getLatitude();
double longitude = location.getLongitude();
}
public void onStatusChanged(String provider, int status, Bundle extras) {}
public void onProviderEnabled(String provider) {}
public void onProviderDisabled(String provider) {}
};
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);