I'm developing an application which needs to retrieve user location for periods of time. I have used LocationListener interface in activities and it has worked fine, however when I implement it in my android Service it isn't called. Here's the onCreate method:
public void onCreate() {
super.onCreate();
turned= true;
locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
locationManager = (LocationManager) this
.getSystemService(LOCATION_SERVICE);
String provider = locationManager.getBestProvider(criteria, true);
locationManager
.requestLocationUpdates(provider, 0, 0, this); ...}
I would really appreciate any help, Service seems fine because I send Toast and they are sent, but onLocationUpdate is never called.