Android: If both GPS & Network are requested at the same time, network provider doesn't work
- 阅读更多 关于 Android: If both GPS & Network are requested at the same time, network provider doesn't work
问题 if (gps_enabled) _locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListenerGps); if (network_enabled) _locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListenerNetwork); Condition: You are in the building where you have wifi connection, but no GPS signal. Result: This works when Setting->"Use wireless networks" is on and "Use GPS satellites" is off. However, when both are checked, above code sometimes works (through