我希望通过Wifi获取位置并在谷歌地图中工作,这对我不起作用,但Gps没问题,也没问题.
我的代码:
locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
if (locationManager != null) {
boolean gpsIsEnabled = locationManager
.isProviderEnabled(LocationManager.GPS_PROVIDER);
boolean networkIsEnabled = locationManager
.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
if (gpsIsEnabled) {
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER,5000L,10F,(android.location.LocationListener) this);
} else if (networkIsEnabled) {
locationManager.requestLocationUpdates(
LocationManager.NETWORK_PROVIDER,(android.location.LocationListener) this);
} else {
// Show an error dialog that GPS is disabled...
}
} else {
// Show some generic error dialog because s