In my Service I track my location every X minutes. I Try with
LocationManager lm=(LocationManager)getApplicationContext().getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_COARSE);
criteria.setAltitudeRequired(false);
criteria.setBearingRequired(false);
String provider=lm.getBestProvider( criteria, true );
if (provider!=null){
lm.requestLocationUpdates(provider,5000,1,locationListenerNetwork);
}
Using Network location, and if it's not avaible i try with gps location.
The problem is that when provider is avaible, i try to ask for a location with
lm.requestLocationUpdates(provider,5000,0,locationListenerNetwork);
where LocationListenerNetwork is my LocationListener, but nothing happends, my
onLocationChanged(Location location)
inside LocationListenerNetwork is never called
If I Use GPS (with ACCESS_FINE_LOCATION permissions) onlocationchanged is called and everything works fine.
This happends only in Galaxy S3 jb (4.1). (correctly setted) Before update, and on other smartphones, everything works fine:
I Tried on
- Galaxy Nexus 4.2
- Galaxy Nexus 4.1
- Nexus S 4.1
- Galaxy S
- Galaxy Note
Everywhere my code works fine, but in S3 JB I can't understand how to solve. Another strange thing is that gmaps perfectly tracks position also without gps, so it can't be a device problem.