private void initLocationManager() { if ((mosaicUser != null) && (locationManager == null)) { locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); for (String provider : providers) { if (locationManager.isProviderEnabled(provider)) initLocationUpdates(provider); } } }
@Override public void onProviderEnabled(String provider) { if (LocationManager.GPS_PROVIDER.equals(provider) || LocationManager.NETWORK_PROVIDER.equals(provider)) initLocationUpdates(provider); }